1#![doc = "MAVLink development dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#![allow(clippy::match_single_binding)]
6#[cfg(feature = "arbitrary")]
7use arbitrary::Arbitrary;
8#[allow(unused_imports)]
9use bitflags::{bitflags, Flags};
10#[allow(unused_imports)]
11use mavlink_core::{
12 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
13};
14#[allow(unused_imports)]
15use num_derive::{FromPrimitive, ToPrimitive};
16#[allow(unused_imports)]
17use num_traits::{FromPrimitive, ToPrimitive};
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 0u8;
23pub const DIALECT_NUMBER: u8 = 0u8;
24#[cfg_attr(feature = "ts", derive(TS))]
25#[cfg_attr(feature = "ts", ts(export))]
26#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28#[cfg_attr(feature = "serde", serde(tag = "type"))]
29#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30#[repr(u32)]
31#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
32pub enum ActuatorConfiguration {
33 #[doc = "Do nothing."]
34 ACTUATOR_CONFIGURATION_NONE = 0,
35 #[doc = "Command the actuator to beep now."]
36 ACTUATOR_CONFIGURATION_BEEP = 1,
37 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
38 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
39 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
40 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
41 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
42 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
43 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
44 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
45}
46impl ActuatorConfiguration {
47 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
48}
49impl Default for ActuatorConfiguration {
50 fn default() -> Self {
51 Self::DEFAULT
52 }
53}
54#[cfg_attr(feature = "ts", derive(TS))]
55#[cfg_attr(feature = "ts", ts(export))]
56#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
57#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
58#[cfg_attr(feature = "serde", serde(tag = "type"))]
59#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
60#[repr(u32)]
61#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
62pub enum ActuatorOutputFunction {
63 #[doc = "No function (disabled)."]
64 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
65 #[doc = "Motor 1"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
67 #[doc = "Motor 2"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
69 #[doc = "Motor 3"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
71 #[doc = "Motor 4"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
73 #[doc = "Motor 5"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
75 #[doc = "Motor 6"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
77 #[doc = "Motor 7"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
79 #[doc = "Motor 8"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
81 #[doc = "Motor 9"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
83 #[doc = "Motor 10"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
85 #[doc = "Motor 11"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
87 #[doc = "Motor 12"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
89 #[doc = "Motor 13"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
91 #[doc = "Motor 14"]
92 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
93 #[doc = "Motor 15"]
94 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
95 #[doc = "Motor 16"]
96 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
97 #[doc = "Servo 1"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
99 #[doc = "Servo 2"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
101 #[doc = "Servo 3"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
103 #[doc = "Servo 4"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
105 #[doc = "Servo 5"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
107 #[doc = "Servo 6"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
109 #[doc = "Servo 7"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
111 #[doc = "Servo 8"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
113 #[doc = "Servo 9"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
115 #[doc = "Servo 10"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
117 #[doc = "Servo 11"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
119 #[doc = "Servo 12"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
121 #[doc = "Servo 13"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
123 #[doc = "Servo 14"]
124 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
125 #[doc = "Servo 15"]
126 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
127 #[doc = "Servo 16"]
128 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
129}
130impl ActuatorOutputFunction {
131 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
132}
133impl Default for ActuatorOutputFunction {
134 fn default() -> Self {
135 Self::DEFAULT
136 }
137}
138#[cfg_attr(feature = "ts", derive(TS))]
139#[cfg_attr(feature = "ts", ts(export))]
140#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
142#[cfg_attr(feature = "serde", serde(tag = "type"))]
143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
144#[repr(u32)]
145#[doc = "Enumeration of the ADSB altimeter types"]
146pub enum AdsbAltitudeType {
147 #[doc = "Altitude reported from a Baro source using QNH reference"]
148 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
149 #[doc = "Altitude reported from a GNSS source"]
150 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
151}
152impl AdsbAltitudeType {
153 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
154}
155impl Default for AdsbAltitudeType {
156 fn default() -> Self {
157 Self::DEFAULT
158 }
159}
160#[cfg_attr(feature = "ts", derive(TS))]
161#[cfg_attr(feature = "ts", ts(export))]
162#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
164#[cfg_attr(feature = "serde", serde(tag = "type"))]
165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
166#[repr(u32)]
167#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
168pub enum AdsbEmitterType {
169 ADSB_EMITTER_TYPE_NO_INFO = 0,
170 ADSB_EMITTER_TYPE_LIGHT = 1,
171 ADSB_EMITTER_TYPE_SMALL = 2,
172 ADSB_EMITTER_TYPE_LARGE = 3,
173 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
174 ADSB_EMITTER_TYPE_HEAVY = 5,
175 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
176 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
177 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
178 ADSB_EMITTER_TYPE_GLIDER = 9,
179 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
180 ADSB_EMITTER_TYPE_PARACHUTE = 11,
181 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
182 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
183 ADSB_EMITTER_TYPE_UAV = 14,
184 ADSB_EMITTER_TYPE_SPACE = 15,
185 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
186 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
187 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
188 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
189}
190impl AdsbEmitterType {
191 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
192}
193impl Default for AdsbEmitterType {
194 fn default() -> Self {
195 Self::DEFAULT
196 }
197}
198bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
199impl AdsbFlags {
200 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
201}
202impl Default for AdsbFlags {
203 fn default() -> Self {
204 Self::DEFAULT
205 }
206}
207bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Airspeed sensor flags"] pub struct AirspeedSensorFlags : u8 { # [doc = "Airspeed sensor is unhealthy"] const AIRSPEED_SENSOR_UNHEALTHY = 1 ; # [doc = "True if the data from this sensor is being actively used by the flight controller for guidance, navigation or control."] const AIRSPEED_SENSOR_USING = 2 ; } }
208impl AirspeedSensorFlags {
209 pub const DEFAULT: Self = Self::AIRSPEED_SENSOR_UNHEALTHY;
210}
211impl Default for AirspeedSensorFlags {
212 fn default() -> Self {
213 Self::DEFAULT
214 }
215}
216bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
217impl AisFlags {
218 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
219}
220impl Default for AisFlags {
221 fn default() -> Self {
222 Self::DEFAULT
223 }
224}
225#[cfg_attr(feature = "ts", derive(TS))]
226#[cfg_attr(feature = "ts", ts(export))]
227#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
229#[cfg_attr(feature = "serde", serde(tag = "type"))]
230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
231#[repr(u32)]
232#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
233pub enum AisNavStatus {
234 #[doc = "Under way using engine."]
235 UNDER_WAY = 0,
236 AIS_NAV_ANCHORED = 1,
237 AIS_NAV_UN_COMMANDED = 2,
238 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
239 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
240 AIS_NAV_MOORED = 5,
241 AIS_NAV_AGROUND = 6,
242 AIS_NAV_FISHING = 7,
243 AIS_NAV_SAILING = 8,
244 AIS_NAV_RESERVED_HSC = 9,
245 AIS_NAV_RESERVED_WIG = 10,
246 AIS_NAV_RESERVED_1 = 11,
247 AIS_NAV_RESERVED_2 = 12,
248 AIS_NAV_RESERVED_3 = 13,
249 #[doc = "Search And Rescue Transponder."]
250 AIS_NAV_AIS_SART = 14,
251 #[doc = "Not available (default)."]
252 AIS_NAV_UNKNOWN = 15,
253}
254impl AisNavStatus {
255 pub const DEFAULT: Self = Self::UNDER_WAY;
256}
257impl Default for AisNavStatus {
258 fn default() -> Self {
259 Self::DEFAULT
260 }
261}
262#[cfg_attr(feature = "ts", derive(TS))]
263#[cfg_attr(feature = "ts", ts(export))]
264#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
265#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
266#[cfg_attr(feature = "serde", serde(tag = "type"))]
267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
268#[repr(u32)]
269#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
270pub enum AisType {
271 #[doc = "Not available (default)."]
272 AIS_TYPE_UNKNOWN = 0,
273 AIS_TYPE_RESERVED_1 = 1,
274 AIS_TYPE_RESERVED_2 = 2,
275 AIS_TYPE_RESERVED_3 = 3,
276 AIS_TYPE_RESERVED_4 = 4,
277 AIS_TYPE_RESERVED_5 = 5,
278 AIS_TYPE_RESERVED_6 = 6,
279 AIS_TYPE_RESERVED_7 = 7,
280 AIS_TYPE_RESERVED_8 = 8,
281 AIS_TYPE_RESERVED_9 = 9,
282 AIS_TYPE_RESERVED_10 = 10,
283 AIS_TYPE_RESERVED_11 = 11,
284 AIS_TYPE_RESERVED_12 = 12,
285 AIS_TYPE_RESERVED_13 = 13,
286 AIS_TYPE_RESERVED_14 = 14,
287 AIS_TYPE_RESERVED_15 = 15,
288 AIS_TYPE_RESERVED_16 = 16,
289 AIS_TYPE_RESERVED_17 = 17,
290 AIS_TYPE_RESERVED_18 = 18,
291 AIS_TYPE_RESERVED_19 = 19,
292 #[doc = "Wing In Ground effect."]
293 AIS_TYPE_WIG = 20,
294 AIS_TYPE_WIG_HAZARDOUS_A = 21,
295 AIS_TYPE_WIG_HAZARDOUS_B = 22,
296 AIS_TYPE_WIG_HAZARDOUS_C = 23,
297 AIS_TYPE_WIG_HAZARDOUS_D = 24,
298 AIS_TYPE_WIG_RESERVED_1 = 25,
299 AIS_TYPE_WIG_RESERVED_2 = 26,
300 AIS_TYPE_WIG_RESERVED_3 = 27,
301 AIS_TYPE_WIG_RESERVED_4 = 28,
302 AIS_TYPE_WIG_RESERVED_5 = 29,
303 AIS_TYPE_FISHING = 30,
304 AIS_TYPE_TOWING = 31,
305 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
306 AIS_TYPE_TOWING_LARGE = 32,
307 #[doc = "Dredging or other underwater ops."]
308 AIS_TYPE_DREDGING = 33,
309 AIS_TYPE_DIVING = 34,
310 AIS_TYPE_MILITARY = 35,
311 AIS_TYPE_SAILING = 36,
312 AIS_TYPE_PLEASURE = 37,
313 AIS_TYPE_RESERVED_20 = 38,
314 AIS_TYPE_RESERVED_21 = 39,
315 #[doc = "High Speed Craft."]
316 AIS_TYPE_HSC = 40,
317 AIS_TYPE_HSC_HAZARDOUS_A = 41,
318 AIS_TYPE_HSC_HAZARDOUS_B = 42,
319 AIS_TYPE_HSC_HAZARDOUS_C = 43,
320 AIS_TYPE_HSC_HAZARDOUS_D = 44,
321 AIS_TYPE_HSC_RESERVED_1 = 45,
322 AIS_TYPE_HSC_RESERVED_2 = 46,
323 AIS_TYPE_HSC_RESERVED_3 = 47,
324 AIS_TYPE_HSC_RESERVED_4 = 48,
325 AIS_TYPE_HSC_UNKNOWN = 49,
326 AIS_TYPE_PILOT = 50,
327 #[doc = "Search And Rescue vessel."]
328 AIS_TYPE_SAR = 51,
329 AIS_TYPE_TUG = 52,
330 AIS_TYPE_PORT_TENDER = 53,
331 #[doc = "Anti-pollution equipment."]
332 AIS_TYPE_ANTI_POLLUTION = 54,
333 AIS_TYPE_LAW_ENFORCEMENT = 55,
334 AIS_TYPE_SPARE_LOCAL_1 = 56,
335 AIS_TYPE_SPARE_LOCAL_2 = 57,
336 AIS_TYPE_MEDICAL_TRANSPORT = 58,
337 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
338 AIS_TYPE_NONECOMBATANT = 59,
339 AIS_TYPE_PASSENGER = 60,
340 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
341 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
342 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
343 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
344 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
345 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
346 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
347 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
348 AIS_TYPE_PASSENGER_UNKNOWN = 69,
349 AIS_TYPE_CARGO = 70,
350 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
351 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
352 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
353 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
354 AIS_TYPE_CARGO_RESERVED_1 = 75,
355 AIS_TYPE_CARGO_RESERVED_2 = 76,
356 AIS_TYPE_CARGO_RESERVED_3 = 77,
357 AIS_TYPE_CARGO_RESERVED_4 = 78,
358 AIS_TYPE_CARGO_UNKNOWN = 79,
359 AIS_TYPE_TANKER = 80,
360 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
361 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
362 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
363 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
364 AIS_TYPE_TANKER_RESERVED_1 = 85,
365 AIS_TYPE_TANKER_RESERVED_2 = 86,
366 AIS_TYPE_TANKER_RESERVED_3 = 87,
367 AIS_TYPE_TANKER_RESERVED_4 = 88,
368 AIS_TYPE_TANKER_UNKNOWN = 89,
369 AIS_TYPE_OTHER = 90,
370 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
371 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
372 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
373 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
374 AIS_TYPE_OTHER_RESERVED_1 = 95,
375 AIS_TYPE_OTHER_RESERVED_2 = 96,
376 AIS_TYPE_OTHER_RESERVED_3 = 97,
377 AIS_TYPE_OTHER_RESERVED_4 = 98,
378 AIS_TYPE_OTHER_UNKNOWN = 99,
379}
380impl AisType {
381 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
382}
383impl Default for AisType {
384 fn default() -> Self {
385 Self::DEFAULT
386 }
387}
388bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
389impl AttitudeTargetTypemask {
390 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
391}
392impl Default for AttitudeTargetTypemask {
393 fn default() -> Self {
394 Self::DEFAULT
395 }
396}
397#[cfg_attr(feature = "ts", derive(TS))]
398#[cfg_attr(feature = "ts", ts(export))]
399#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
401#[cfg_attr(feature = "serde", serde(tag = "type"))]
402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
403#[repr(u32)]
404#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
405pub enum AutotuneAxis {
406 #[doc = "Autotune roll axis."]
407 AUTOTUNE_AXIS_ROLL = 1,
408 #[doc = "Autotune pitch axis."]
409 AUTOTUNE_AXIS_PITCH = 2,
410 #[doc = "Autotune yaw axis."]
411 AUTOTUNE_AXIS_YAW = 4,
412}
413impl AutotuneAxis {
414 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
415}
416impl Default for AutotuneAxis {
417 fn default() -> Self {
418 Self::DEFAULT
419 }
420}
421bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
422impl CameraCapFlags {
423 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
424}
425impl Default for CameraCapFlags {
426 fn default() -> Self {
427 Self::DEFAULT
428 }
429}
430#[cfg_attr(feature = "ts", derive(TS))]
431#[cfg_attr(feature = "ts", ts(export))]
432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
434#[cfg_attr(feature = "serde", serde(tag = "type"))]
435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
436#[repr(u32)]
437#[doc = "Camera Modes."]
438pub enum CameraMode {
439 #[doc = "Camera is in image/photo capture mode."]
440 CAMERA_MODE_IMAGE = 0,
441 #[doc = "Camera is in video capture mode."]
442 CAMERA_MODE_VIDEO = 1,
443 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
444 CAMERA_MODE_IMAGE_SURVEY = 2,
445}
446impl CameraMode {
447 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
448}
449impl Default for CameraMode {
450 fn default() -> Self {
451 Self::DEFAULT
452 }
453}
454#[cfg_attr(feature = "ts", derive(TS))]
455#[cfg_attr(feature = "ts", ts(export))]
456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
458#[cfg_attr(feature = "serde", serde(tag = "type"))]
459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
460#[repr(u32)]
461#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
462pub enum CameraSource {
463 #[doc = "Default camera source."]
464 CAMERA_SOURCE_DEFAULT = 0,
465 #[doc = "RGB camera source."]
466 CAMERA_SOURCE_RGB = 1,
467 #[doc = "IR camera source."]
468 CAMERA_SOURCE_IR = 2,
469 #[doc = "NDVI camera source."]
470 CAMERA_SOURCE_NDVI = 3,
471}
472impl CameraSource {
473 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
474}
475impl Default for CameraSource {
476 fn default() -> Self {
477 Self::DEFAULT
478 }
479}
480#[cfg_attr(feature = "ts", derive(TS))]
481#[cfg_attr(feature = "ts", ts(export))]
482#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
484#[cfg_attr(feature = "serde", serde(tag = "type"))]
485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
486#[repr(u32)]
487#[doc = "Camera tracking modes"]
488pub enum CameraTrackingMode {
489 #[doc = "Not tracking"]
490 CAMERA_TRACKING_MODE_NONE = 0,
491 #[doc = "Target is a point"]
492 CAMERA_TRACKING_MODE_POINT = 1,
493 #[doc = "Target is a rectangle"]
494 CAMERA_TRACKING_MODE_RECTANGLE = 2,
495}
496impl CameraTrackingMode {
497 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
498}
499impl Default for CameraTrackingMode {
500 fn default() -> Self {
501 Self::DEFAULT
502 }
503}
504#[cfg_attr(feature = "ts", derive(TS))]
505#[cfg_attr(feature = "ts", ts(export))]
506#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
508#[cfg_attr(feature = "serde", serde(tag = "type"))]
509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
510#[repr(u32)]
511#[doc = "Camera tracking status flags"]
512pub enum CameraTrackingStatusFlags {
513 #[doc = "Camera is not tracking"]
514 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
515 #[doc = "Camera is tracking"]
516 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
517 #[doc = "Camera tracking in error state"]
518 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
519}
520impl CameraTrackingStatusFlags {
521 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
522}
523impl Default for CameraTrackingStatusFlags {
524 fn default() -> Self {
525 Self::DEFAULT
526 }
527}
528bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
529impl CameraTrackingTargetData {
530 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
531}
532impl Default for CameraTrackingTargetData {
533 fn default() -> Self {
534 Self::DEFAULT
535 }
536}
537#[cfg_attr(feature = "ts", derive(TS))]
538#[cfg_attr(feature = "ts", ts(export))]
539#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
541#[cfg_attr(feature = "serde", serde(tag = "type"))]
542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
543#[repr(u32)]
544#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
545pub enum CameraZoomType {
546 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
547 ZOOM_TYPE_STEP = 0,
548 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
549 ZOOM_TYPE_CONTINUOUS = 1,
550 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
551 ZOOM_TYPE_RANGE = 2,
552 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
553 ZOOM_TYPE_FOCAL_LENGTH = 3,
554 #[doc = "Zoom value as horizontal field of view in degrees."]
555 ZOOM_TYPE_HORIZONTAL_FOV = 4,
556}
557impl CameraZoomType {
558 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
559}
560impl Default for CameraZoomType {
561 fn default() -> Self {
562 Self::DEFAULT
563 }
564}
565#[cfg_attr(feature = "ts", derive(TS))]
566#[cfg_attr(feature = "ts", ts(export))]
567#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
569#[cfg_attr(feature = "serde", serde(tag = "type"))]
570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
571#[repr(u32)]
572pub enum CanFilterOp {
573 CAN_FILTER_REPLACE = 0,
574 CAN_FILTER_ADD = 1,
575 CAN_FILTER_REMOVE = 2,
576}
577impl CanFilterOp {
578 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
579}
580impl Default for CanFilterOp {
581 fn default() -> Self {
582 Self::DEFAULT
583 }
584}
585#[cfg_attr(feature = "ts", derive(TS))]
586#[cfg_attr(feature = "ts", ts(export))]
587#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
589#[cfg_attr(feature = "serde", serde(tag = "type"))]
590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
591#[repr(u32)]
592#[doc = "Possible responses from a CELLULAR_CONFIG message."]
593pub enum CellularConfigResponse {
594 #[doc = "Changes accepted."]
595 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
596 #[doc = "Invalid APN."]
597 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
598 #[doc = "Invalid PIN."]
599 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
600 #[doc = "Changes rejected."]
601 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
602 #[doc = "PUK is required to unblock SIM card."]
603 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
604}
605impl CellularConfigResponse {
606 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
607}
608impl Default for CellularConfigResponse {
609 fn default() -> Self {
610 Self::DEFAULT
611 }
612}
613#[cfg_attr(feature = "ts", derive(TS))]
614#[cfg_attr(feature = "ts", ts(export))]
615#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
617#[cfg_attr(feature = "serde", serde(tag = "type"))]
618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
619#[repr(u32)]
620#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
621pub enum CellularNetworkFailedReason {
622 #[doc = "No error"]
623 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
624 #[doc = "Error state is unknown"]
625 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
626 #[doc = "SIM is required for the modem but missing"]
627 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
628 #[doc = "SIM is available, but not usable for connection"]
629 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
630}
631impl CellularNetworkFailedReason {
632 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
633}
634impl Default for CellularNetworkFailedReason {
635 fn default() -> Self {
636 Self::DEFAULT
637 }
638}
639#[cfg_attr(feature = "ts", derive(TS))]
640#[cfg_attr(feature = "ts", ts(export))]
641#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
643#[cfg_attr(feature = "serde", serde(tag = "type"))]
644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
645#[repr(u32)]
646#[doc = "Cellular network radio type"]
647pub enum CellularNetworkRadioType {
648 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
649 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
650 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
651 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
652 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
653}
654impl CellularNetworkRadioType {
655 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
656}
657impl Default for CellularNetworkRadioType {
658 fn default() -> Self {
659 Self::DEFAULT
660 }
661}
662#[cfg_attr(feature = "ts", derive(TS))]
663#[cfg_attr(feature = "ts", ts(export))]
664#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
666#[cfg_attr(feature = "serde", serde(tag = "type"))]
667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
668#[repr(u32)]
669#[doc = "These flags encode the cellular network status"]
670pub enum CellularStatusFlag {
671 #[doc = "State unknown or not reportable."]
672 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
673 #[doc = "Modem is unusable"]
674 CELLULAR_STATUS_FLAG_FAILED = 1,
675 #[doc = "Modem is being initialized"]
676 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
677 #[doc = "Modem is locked"]
678 CELLULAR_STATUS_FLAG_LOCKED = 3,
679 #[doc = "Modem is not enabled and is powered down"]
680 CELLULAR_STATUS_FLAG_DISABLED = 4,
681 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
682 CELLULAR_STATUS_FLAG_DISABLING = 5,
683 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
684 CELLULAR_STATUS_FLAG_ENABLING = 6,
685 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
686 CELLULAR_STATUS_FLAG_ENABLED = 7,
687 #[doc = "Modem is searching for a network provider to register"]
688 CELLULAR_STATUS_FLAG_SEARCHING = 8,
689 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
690 CELLULAR_STATUS_FLAG_REGISTERED = 9,
691 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
692 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
693 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
694 CELLULAR_STATUS_FLAG_CONNECTING = 11,
695 #[doc = "One or more packet data bearers is active and connected"]
696 CELLULAR_STATUS_FLAG_CONNECTED = 12,
697}
698impl CellularStatusFlag {
699 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
700}
701impl Default for CellularStatusFlag {
702 fn default() -> Self {
703 Self::DEFAULT
704 }
705}
706#[cfg_attr(feature = "ts", derive(TS))]
707#[cfg_attr(feature = "ts", ts(export))]
708#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
710#[cfg_attr(feature = "serde", serde(tag = "type"))]
711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
712#[repr(u32)]
713#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
714pub enum CompMetadataType {
715 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
716 COMP_METADATA_TYPE_GENERAL = 0,
717 #[doc = "Parameter meta data."]
718 COMP_METADATA_TYPE_PARAMETER = 1,
719 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
720 COMP_METADATA_TYPE_COMMANDS = 2,
721 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
722 COMP_METADATA_TYPE_PERIPHERALS = 3,
723 #[doc = "Meta data for the events interface."]
724 COMP_METADATA_TYPE_EVENTS = 4,
725 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
726 COMP_METADATA_TYPE_ACTUATORS = 5,
727}
728impl CompMetadataType {
729 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
730}
731impl Default for CompMetadataType {
732 fn default() -> Self {
733 Self::DEFAULT
734 }
735}
736#[cfg_attr(feature = "ts", derive(TS))]
737#[cfg_attr(feature = "ts", ts(export))]
738#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
740#[cfg_attr(feature = "serde", serde(tag = "type"))]
741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
742#[repr(u32)]
743#[doc = "Indicates the ESC connection type."]
744pub enum EscConnectionType {
745 #[doc = "Traditional PPM ESC."]
746 ESC_CONNECTION_TYPE_PPM = 0,
747 #[doc = "Serial Bus connected ESC."]
748 ESC_CONNECTION_TYPE_SERIAL = 1,
749 #[doc = "One Shot PPM ESC."]
750 ESC_CONNECTION_TYPE_ONESHOT = 2,
751 #[doc = "I2C ESC."]
752 ESC_CONNECTION_TYPE_I2C = 3,
753 #[doc = "CAN-Bus ESC."]
754 ESC_CONNECTION_TYPE_CAN = 4,
755 #[doc = "DShot ESC."]
756 ESC_CONNECTION_TYPE_DSHOT = 5,
757}
758impl EscConnectionType {
759 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
760}
761impl Default for EscConnectionType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
767impl EscFailureFlags {
768 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
769}
770impl Default for EscFailureFlags {
771 fn default() -> Self {
772 Self::DEFAULT
773 }
774}
775bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
776impl EstimatorStatusFlags {
777 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
778}
779impl Default for EstimatorStatusFlags {
780 fn default() -> Self {
781 Self::DEFAULT
782 }
783}
784#[cfg_attr(feature = "ts", derive(TS))]
785#[cfg_attr(feature = "ts", ts(export))]
786#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
788#[cfg_attr(feature = "serde", serde(tag = "type"))]
789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
790#[repr(u32)]
791#[doc = "List of possible failure type to inject."]
792pub enum FailureType {
793 #[doc = "No failure injected, used to reset a previous failure."]
794 FAILURE_TYPE_OK = 0,
795 #[doc = "Sets unit off, so completely non-responsive."]
796 FAILURE_TYPE_OFF = 1,
797 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
798 FAILURE_TYPE_STUCK = 2,
799 #[doc = "Unit is reporting complete garbage."]
800 FAILURE_TYPE_GARBAGE = 3,
801 #[doc = "Unit is consistently wrong."]
802 FAILURE_TYPE_WRONG = 4,
803 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
804 FAILURE_TYPE_SLOW = 5,
805 #[doc = "Data of unit is delayed in time."]
806 FAILURE_TYPE_DELAYED = 6,
807 #[doc = "Unit is sometimes working, sometimes not."]
808 FAILURE_TYPE_INTERMITTENT = 7,
809}
810impl FailureType {
811 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
812}
813impl Default for FailureType {
814 fn default() -> Self {
815 Self::DEFAULT
816 }
817}
818#[cfg_attr(feature = "ts", derive(TS))]
819#[cfg_attr(feature = "ts", ts(export))]
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "List of possible units where failures can be injected."]
826pub enum FailureUnit {
827 FAILURE_UNIT_SENSOR_GYRO = 0,
828 FAILURE_UNIT_SENSOR_ACCEL = 1,
829 FAILURE_UNIT_SENSOR_MAG = 2,
830 FAILURE_UNIT_SENSOR_BARO = 3,
831 FAILURE_UNIT_SENSOR_GPS = 4,
832 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
833 FAILURE_UNIT_SENSOR_VIO = 6,
834 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
835 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
836 FAILURE_UNIT_SYSTEM_BATTERY = 100,
837 FAILURE_UNIT_SYSTEM_MOTOR = 101,
838 FAILURE_UNIT_SYSTEM_SERVO = 102,
839 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
840 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
841 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
842}
843impl FailureUnit {
844 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
845}
846impl Default for FailureUnit {
847 fn default() -> Self {
848 Self::DEFAULT
849 }
850}
851#[cfg_attr(feature = "ts", derive(TS))]
852#[cfg_attr(feature = "ts", ts(export))]
853#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
855#[cfg_attr(feature = "serde", serde(tag = "type"))]
856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
857#[repr(u32)]
858pub enum FenceBreach {
859 #[doc = "No last fence breach"]
860 FENCE_BREACH_NONE = 0,
861 #[doc = "Breached minimum altitude"]
862 FENCE_BREACH_MINALT = 1,
863 #[doc = "Breached maximum altitude"]
864 FENCE_BREACH_MAXALT = 2,
865 #[doc = "Breached fence boundary"]
866 FENCE_BREACH_BOUNDARY = 3,
867}
868impl FenceBreach {
869 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
870}
871impl Default for FenceBreach {
872 fn default() -> Self {
873 Self::DEFAULT
874 }
875}
876#[cfg_attr(feature = "ts", derive(TS))]
877#[cfg_attr(feature = "ts", ts(export))]
878#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
880#[cfg_attr(feature = "serde", serde(tag = "type"))]
881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
882#[repr(u32)]
883#[doc = "Actions being taken to mitigate/prevent fence breach"]
884pub enum FenceMitigate {
885 #[doc = "Unknown"]
886 FENCE_MITIGATE_UNKNOWN = 0,
887 #[doc = "No actions being taken"]
888 FENCE_MITIGATE_NONE = 1,
889 #[doc = "Velocity limiting active to prevent breach"]
890 FENCE_MITIGATE_VEL_LIMIT = 2,
891}
892impl FenceMitigate {
893 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
894}
895impl Default for FenceMitigate {
896 fn default() -> Self {
897 Self::DEFAULT
898 }
899}
900#[cfg_attr(feature = "ts", derive(TS))]
901#[cfg_attr(feature = "ts", ts(export))]
902#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
904#[cfg_attr(feature = "serde", serde(tag = "type"))]
905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
906#[repr(u32)]
907#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
908pub enum FenceType {
909 #[doc = "Maximum altitude fence"]
910 FENCE_TYPE_ALT_MAX = 1,
911 #[doc = "Circle fence"]
912 FENCE_TYPE_CIRCLE = 2,
913 #[doc = "Polygon fence"]
914 FENCE_TYPE_POLYGON = 4,
915 #[doc = "Minimum altitude fence"]
916 FENCE_TYPE_ALT_MIN = 8,
917}
918impl FenceType {
919 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
920}
921impl Default for FenceType {
922 fn default() -> Self {
923 Self::DEFAULT
924 }
925}
926#[cfg_attr(feature = "ts", derive(TS))]
927#[cfg_attr(feature = "ts", ts(export))]
928#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
930#[cfg_attr(feature = "serde", serde(tag = "type"))]
931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
932#[repr(u32)]
933#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
934pub enum FirmwareVersionType {
935 #[doc = "development release"]
936 FIRMWARE_VERSION_TYPE_DEV = 0,
937 #[doc = "alpha release"]
938 FIRMWARE_VERSION_TYPE_ALPHA = 64,
939 #[doc = "beta release"]
940 FIRMWARE_VERSION_TYPE_BETA = 128,
941 #[doc = "release candidate"]
942 FIRMWARE_VERSION_TYPE_RC = 192,
943 #[doc = "official stable release"]
944 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
945}
946impl FirmwareVersionType {
947 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
948}
949impl Default for FirmwareVersionType {
950 fn default() -> Self {
951 Self::DEFAULT
952 }
953}
954bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "CONTROL_STATUS flags."] pub struct GcsControlStatusFlags : u8 { # [doc = "If set, this CONTROL_STATUS publishes the controlling GCS for the whole system. If unset, the CONTROL_STATUS indicates the controlling GCS for just the component emitting the message. Note that to request control of the system a GCS should send MAV_CMD_REQUEST_OPERATOR_CONTROL to the component emitting CONTROL_STATUS with this flag set."] const GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER = 1 ; # [doc = "Takeover allowed (requests for control will be granted). If not set requests for control will be rejected, but the controlling GCS will be notified (and may release control or allow takeover)."] const GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED = 2 ; } }
955impl GcsControlStatusFlags {
956 pub const DEFAULT: Self = Self::GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER;
957}
958impl Default for GcsControlStatusFlags {
959 fn default() -> Self {
960 Self::DEFAULT
961 }
962}
963bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
964impl GimbalDeviceCapFlags {
965 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
966}
967impl Default for GimbalDeviceCapFlags {
968 fn default() -> Self {
969 Self::DEFAULT
970 }
971}
972bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
973impl GimbalDeviceErrorFlags {
974 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
975}
976impl Default for GimbalDeviceErrorFlags {
977 fn default() -> Self {
978 Self::DEFAULT
979 }
980}
981bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
982impl GimbalDeviceFlags {
983 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
984}
985impl Default for GimbalDeviceFlags {
986 fn default() -> Self {
987 Self::DEFAULT
988 }
989}
990bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
991impl GimbalManagerCapFlags {
992 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
993}
994impl Default for GimbalManagerCapFlags {
995 fn default() -> Self {
996 Self::DEFAULT
997 }
998}
999bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
1000impl GimbalManagerFlags {
1001 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1002}
1003impl Default for GimbalManagerFlags {
1004 fn default() -> Self {
1005 Self::DEFAULT
1006 }
1007}
1008#[cfg_attr(feature = "ts", derive(TS))]
1009#[cfg_attr(feature = "ts", ts(export))]
1010#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1012#[cfg_attr(feature = "serde", serde(tag = "type"))]
1013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1014#[repr(u32)]
1015#[doc = "Signal authentication state in a GPS receiver."]
1016pub enum GpsAuthenticationState {
1017 #[doc = "The GPS receiver does not provide GPS signal authentication info."]
1018 GPS_AUTHENTICATION_STATE_UNKNOWN = 0,
1019 #[doc = "The GPS receiver is initializing signal authentication."]
1020 GPS_AUTHENTICATION_STATE_INITIALIZING = 1,
1021 #[doc = "The GPS receiver encountered an error while initializing signal authentication."]
1022 GPS_AUTHENTICATION_STATE_ERROR = 2,
1023 #[doc = "The GPS receiver has correctly authenticated all signals."]
1024 GPS_AUTHENTICATION_STATE_OK = 3,
1025 #[doc = "GPS signal authentication is disabled on the receiver."]
1026 GPS_AUTHENTICATION_STATE_DISABLED = 4,
1027}
1028impl GpsAuthenticationState {
1029 pub const DEFAULT: Self = Self::GPS_AUTHENTICATION_STATE_UNKNOWN;
1030}
1031impl Default for GpsAuthenticationState {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Type of GPS fix"]
1044pub enum GpsFixType {
1045 #[doc = "No GPS connected"]
1046 GPS_FIX_TYPE_NO_GPS = 0,
1047 #[doc = "No position information, GPS is connected"]
1048 GPS_FIX_TYPE_NO_FIX = 1,
1049 #[doc = "2D position"]
1050 GPS_FIX_TYPE_2D_FIX = 2,
1051 #[doc = "3D position"]
1052 GPS_FIX_TYPE_3D_FIX = 3,
1053 #[doc = "DGPS/SBAS aided 3D position"]
1054 GPS_FIX_TYPE_DGPS = 4,
1055 #[doc = "RTK float, 3D position"]
1056 GPS_FIX_TYPE_RTK_FLOAT = 5,
1057 #[doc = "RTK Fixed, 3D position"]
1058 GPS_FIX_TYPE_RTK_FIXED = 6,
1059 #[doc = "Static fixed, typically used for base stations"]
1060 GPS_FIX_TYPE_STATIC = 7,
1061 #[doc = "PPP, 3D position."]
1062 GPS_FIX_TYPE_PPP = 8,
1063}
1064impl GpsFixType {
1065 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1066}
1067impl Default for GpsFixType {
1068 fn default() -> Self {
1069 Self::DEFAULT
1070 }
1071}
1072bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1073impl GpsInputIgnoreFlags {
1074 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1075}
1076impl Default for GpsInputIgnoreFlags {
1077 fn default() -> Self {
1078 Self::DEFAULT
1079 }
1080}
1081#[cfg_attr(feature = "ts", derive(TS))]
1082#[cfg_attr(feature = "ts", ts(export))]
1083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1085#[cfg_attr(feature = "serde", serde(tag = "type"))]
1086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1087#[repr(u32)]
1088#[doc = "Signal jamming state in a GPS receiver."]
1089pub enum GpsJammingState {
1090 #[doc = "The GPS receiver does not provide GPS signal jamming info."]
1091 GPS_JAMMING_STATE_UNKNOWN = 0,
1092 #[doc = "The GPS receiver detected no signal jamming."]
1093 GPS_JAMMING_STATE_OK = 1,
1094 #[doc = "The GPS receiver detected and mitigated signal jamming."]
1095 GPS_JAMMING_STATE_MITIGATED = 2,
1096 #[doc = "The GPS receiver detected signal jamming."]
1097 GPS_JAMMING_STATE_DETECTED = 3,
1098}
1099impl GpsJammingState {
1100 pub const DEFAULT: Self = Self::GPS_JAMMING_STATE_UNKNOWN;
1101}
1102impl Default for GpsJammingState {
1103 fn default() -> Self {
1104 Self::DEFAULT
1105 }
1106}
1107#[cfg_attr(feature = "ts", derive(TS))]
1108#[cfg_attr(feature = "ts", ts(export))]
1109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1111#[cfg_attr(feature = "serde", serde(tag = "type"))]
1112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1113#[repr(u32)]
1114#[doc = "State of RAIM processing."]
1115pub enum GpsRaimState {
1116 #[doc = "RAIM capability is unknown."]
1117 GPS_RAIM_STATE_UNKNOWN = 0,
1118 #[doc = "RAIM is disabled."]
1119 GPS_RAIM_STATE_DISABLED = 1,
1120 #[doc = "RAIM integrity check was successful."]
1121 GPS_RAIM_STATE_OK = 2,
1122 #[doc = "RAIM integrity check failed."]
1123 GPS_RAIM_STATE_FAILED = 3,
1124}
1125impl GpsRaimState {
1126 pub const DEFAULT: Self = Self::GPS_RAIM_STATE_UNKNOWN;
1127}
1128impl Default for GpsRaimState {
1129 fn default() -> Self {
1130 Self::DEFAULT
1131 }
1132}
1133#[cfg_attr(feature = "ts", derive(TS))]
1134#[cfg_attr(feature = "ts", ts(export))]
1135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1137#[cfg_attr(feature = "serde", serde(tag = "type"))]
1138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1139#[repr(u32)]
1140#[doc = "Signal spoofing state in a GPS receiver."]
1141pub enum GpsSpoofingState {
1142 #[doc = "The GPS receiver does not provide GPS signal spoofing info."]
1143 GPS_SPOOFING_STATE_UNKNOWN = 0,
1144 #[doc = "The GPS receiver detected no signal spoofing."]
1145 GPS_SPOOFING_STATE_OK = 1,
1146 #[doc = "The GPS receiver detected and mitigated signal spoofing."]
1147 GPS_SPOOFING_STATE_MITIGATED = 2,
1148 #[doc = "The GPS receiver detected signal spoofing but still has a fix."]
1149 GPS_SPOOFING_STATE_DETECTED = 3,
1150}
1151impl GpsSpoofingState {
1152 pub const DEFAULT: Self = Self::GPS_SPOOFING_STATE_UNKNOWN;
1153}
1154impl Default for GpsSpoofingState {
1155 fn default() -> Self {
1156 Self::DEFAULT
1157 }
1158}
1159bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags indicating errors in a GPS receiver."] pub struct GpsSystemErrorFlags : u32 { # [doc = "There are problems with incoming correction streams."] const GPS_SYSTEM_ERROR_INCOMING_CORRECTIONS = 1 ; # [doc = "There are problems with the configuration."] const GPS_SYSTEM_ERROR_CONFIGURATION = 2 ; # [doc = "There are problems with the software on the GPS receiver."] const GPS_SYSTEM_ERROR_SOFTWARE = 4 ; # [doc = "There are problems with an antenna connected to the GPS receiver."] const GPS_SYSTEM_ERROR_ANTENNA = 8 ; # [doc = "There are problems handling all incoming events."] const GPS_SYSTEM_ERROR_EVENT_CONGESTION = 16 ; # [doc = "The GPS receiver CPU is overloaded."] const GPS_SYSTEM_ERROR_CPU_OVERLOAD = 32 ; # [doc = "The GPS receiver is experiencing output congestion."] const GPS_SYSTEM_ERROR_OUTPUT_CONGESTION = 64 ; } }
1160impl GpsSystemErrorFlags {
1161 pub const DEFAULT: Self = Self::GPS_SYSTEM_ERROR_INCOMING_CORRECTIONS;
1162}
1163impl Default for GpsSystemErrorFlags {
1164 fn default() -> Self {
1165 Self::DEFAULT
1166 }
1167}
1168#[cfg_attr(feature = "ts", derive(TS))]
1169#[cfg_attr(feature = "ts", ts(export))]
1170#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1172#[cfg_attr(feature = "serde", serde(tag = "type"))]
1173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1174#[repr(u32)]
1175#[doc = "Gripper actions."]
1176pub enum GripperActions {
1177 #[doc = "Gripper release cargo."]
1178 GRIPPER_ACTION_RELEASE = 0,
1179 #[doc = "Gripper grab onto cargo."]
1180 GRIPPER_ACTION_GRAB = 1,
1181}
1182impl GripperActions {
1183 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1184}
1185impl Default for GripperActions {
1186 fn default() -> Self {
1187 Self::DEFAULT
1188 }
1189}
1190bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1191impl HighresImuUpdatedFlags {
1192 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1193}
1194impl Default for HighresImuUpdatedFlags {
1195 fn default() -> Self {
1196 Self::DEFAULT
1197 }
1198}
1199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1200impl HilActuatorControlsFlags {
1201 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1202}
1203impl Default for HilActuatorControlsFlags {
1204 fn default() -> Self {
1205 Self::DEFAULT
1206 }
1207}
1208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1209impl HilSensorUpdatedFlags {
1210 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1211}
1212impl Default for HilSensorUpdatedFlags {
1213 fn default() -> Self {
1214 Self::DEFAULT
1215 }
1216}
1217bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1218impl HlFailureFlag {
1219 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1220}
1221impl Default for HlFailureFlag {
1222 fn default() -> Self {
1223 Self::DEFAULT
1224 }
1225}
1226bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1227impl IlluminatorErrorFlags {
1228 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1229}
1230impl Default for IlluminatorErrorFlags {
1231 fn default() -> Self {
1232 Self::DEFAULT
1233 }
1234}
1235#[cfg_attr(feature = "ts", derive(TS))]
1236#[cfg_attr(feature = "ts", ts(export))]
1237#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1239#[cfg_attr(feature = "serde", serde(tag = "type"))]
1240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1241#[repr(u32)]
1242#[doc = "Modes of illuminator"]
1243pub enum IlluminatorMode {
1244 #[doc = "Illuminator mode is not specified/unknown"]
1245 ILLUMINATOR_MODE_UNKNOWN = 0,
1246 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1247 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1248 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1249 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1250}
1251impl IlluminatorMode {
1252 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1253}
1254impl Default for IlluminatorMode {
1255 fn default() -> Self {
1256 Self::DEFAULT
1257 }
1258}
1259#[cfg_attr(feature = "ts", derive(TS))]
1260#[cfg_attr(feature = "ts", ts(export))]
1261#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1263#[cfg_attr(feature = "serde", serde(tag = "type"))]
1264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1265#[repr(u32)]
1266#[doc = "Type of landing target"]
1267pub enum LandingTargetType {
1268 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1269 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1270 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1271 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1272 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1273 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1274 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1275 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1276}
1277impl LandingTargetType {
1278 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1279}
1280impl Default for LandingTargetType {
1281 fn default() -> Self {
1282 Self::DEFAULT
1283 }
1284}
1285#[cfg_attr(feature = "ts", derive(TS))]
1286#[cfg_attr(feature = "ts", ts(export))]
1287#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1289#[cfg_attr(feature = "serde", serde(tag = "type"))]
1290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1291#[repr(u32)]
1292pub enum MagCalStatus {
1293 MAG_CAL_NOT_STARTED = 0,
1294 MAG_CAL_WAITING_TO_START = 1,
1295 MAG_CAL_RUNNING_STEP_ONE = 2,
1296 MAG_CAL_RUNNING_STEP_TWO = 3,
1297 MAG_CAL_SUCCESS = 4,
1298 MAG_CAL_FAILED = 5,
1299 MAG_CAL_BAD_ORIENTATION = 6,
1300 MAG_CAL_BAD_RADIUS = 7,
1301}
1302impl MagCalStatus {
1303 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1304}
1305impl Default for MagCalStatus {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[cfg_attr(feature = "ts", derive(TS))]
1311#[cfg_attr(feature = "ts", ts(export))]
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317pub enum MavArmAuthDeniedReason {
1318 #[doc = "Not a specific reason"]
1319 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1320 #[doc = "Authorizer will send the error as string to GCS"]
1321 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1322 #[doc = "At least one waypoint have a invalid value"]
1323 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1324 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1325 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1326 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1327 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1328 #[doc = "Weather is not good to fly"]
1329 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1330}
1331impl MavArmAuthDeniedReason {
1332 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1333}
1334impl Default for MavArmAuthDeniedReason {
1335 fn default() -> Self {
1336 Self::DEFAULT
1337 }
1338}
1339#[cfg_attr(feature = "ts", derive(TS))]
1340#[cfg_attr(feature = "ts", ts(export))]
1341#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1343#[cfg_attr(feature = "serde", serde(tag = "type"))]
1344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1345#[repr(u32)]
1346#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1347pub enum MavAutopilot {
1348 #[doc = "Generic autopilot, full support for everything"]
1349 MAV_AUTOPILOT_GENERIC = 0,
1350 #[doc = "Reserved for future use."]
1351 MAV_AUTOPILOT_RESERVED = 1,
1352 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1353 MAV_AUTOPILOT_SLUGS = 2,
1354 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1355 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1356 #[doc = "OpenPilot, <http://openpilot.org>"]
1357 MAV_AUTOPILOT_OPENPILOT = 4,
1358 #[doc = "Generic autopilot only supporting simple waypoints"]
1359 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1360 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1361 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1362 #[doc = "Generic autopilot supporting the full mission command set"]
1363 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1364 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1365 MAV_AUTOPILOT_INVALID = 8,
1366 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1367 MAV_AUTOPILOT_PPZ = 9,
1368 #[doc = "UAV Dev Board"]
1369 MAV_AUTOPILOT_UDB = 10,
1370 #[doc = "FlexiPilot"]
1371 MAV_AUTOPILOT_FP = 11,
1372 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1373 MAV_AUTOPILOT_PX4 = 12,
1374 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1375 MAV_AUTOPILOT_SMACCMPILOT = 13,
1376 #[doc = "AutoQuad -- <http://autoquad.org>"]
1377 MAV_AUTOPILOT_AUTOQUAD = 14,
1378 #[doc = "Armazila -- <http://armazila.com>"]
1379 MAV_AUTOPILOT_ARMAZILA = 15,
1380 #[doc = "Aerob -- <http://aerob.ru>"]
1381 MAV_AUTOPILOT_AEROB = 16,
1382 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1383 MAV_AUTOPILOT_ASLUAV = 17,
1384 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1385 MAV_AUTOPILOT_SMARTAP = 18,
1386 #[doc = "AirRails - <http://uaventure.com>"]
1387 MAV_AUTOPILOT_AIRRAILS = 19,
1388 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1389 MAV_AUTOPILOT_REFLEX = 20,
1390}
1391impl MavAutopilot {
1392 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1393}
1394impl Default for MavAutopilot {
1395 fn default() -> Self {
1396 Self::DEFAULT
1397 }
1398}
1399#[cfg_attr(feature = "ts", derive(TS))]
1400#[cfg_attr(feature = "ts", ts(export))]
1401#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1403#[cfg_attr(feature = "serde", serde(tag = "type"))]
1404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1405#[repr(u32)]
1406#[doc = "Enumeration for battery charge states."]
1407pub enum MavBatteryChargeState {
1408 #[doc = "Low battery state is not provided"]
1409 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1410 #[doc = "Battery is not in low state. Normal operation."]
1411 MAV_BATTERY_CHARGE_STATE_OK = 1,
1412 #[doc = "Battery state is low, warn and monitor close."]
1413 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1414 #[doc = "Battery state is critical, return or abort immediately."]
1415 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1416 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1417 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1418 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1419 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1420 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1421 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1422 #[doc = "Battery is charging."]
1423 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1424}
1425impl MavBatteryChargeState {
1426 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1427}
1428impl Default for MavBatteryChargeState {
1429 fn default() -> Self {
1430 Self::DEFAULT
1431 }
1432}
1433bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1434impl MavBatteryFault {
1435 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1436}
1437impl Default for MavBatteryFault {
1438 fn default() -> Self {
1439 Self::DEFAULT
1440 }
1441}
1442#[cfg_attr(feature = "ts", derive(TS))]
1443#[cfg_attr(feature = "ts", ts(export))]
1444#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1446#[cfg_attr(feature = "serde", serde(tag = "type"))]
1447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1448#[repr(u32)]
1449#[doc = "Enumeration of battery functions"]
1450pub enum MavBatteryFunction {
1451 #[doc = "Battery function is unknown"]
1452 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1453 #[doc = "Battery supports all flight systems"]
1454 MAV_BATTERY_FUNCTION_ALL = 1,
1455 #[doc = "Battery for the propulsion system"]
1456 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1457 #[doc = "Avionics battery"]
1458 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1459 #[doc = "Payload battery"]
1460 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1461}
1462impl MavBatteryFunction {
1463 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1464}
1465impl Default for MavBatteryFunction {
1466 fn default() -> Self {
1467 Self::DEFAULT
1468 }
1469}
1470#[cfg_attr(feature = "ts", derive(TS))]
1471#[cfg_attr(feature = "ts", ts(export))]
1472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1474#[cfg_attr(feature = "serde", serde(tag = "type"))]
1475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1476#[repr(u32)]
1477#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1478pub enum MavBatteryMode {
1479 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1480 MAV_BATTERY_MODE_UNKNOWN = 0,
1481 #[doc = "Battery is auto discharging (towards storage level)."]
1482 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1483 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1484 MAV_BATTERY_MODE_HOT_SWAP = 2,
1485}
1486impl MavBatteryMode {
1487 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1488}
1489impl Default for MavBatteryMode {
1490 fn default() -> Self {
1491 Self::DEFAULT
1492 }
1493}
1494bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Battery status flags for fault, health and state indication."] pub struct MavBatteryStatusFlags : u32 { # [doc = "The battery is not ready to use (fly). Set if the battery has faults or other conditions that make it unsafe to fly with. Note: It will be the logical OR of other status bits (chosen by the manufacturer/integrator)."] const MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE = 1 ; # [doc = "Battery is charging."] const MAV_BATTERY_STATUS_FLAGS_CHARGING = 2 ; # [doc = "Battery is cell balancing (during charging). Not ready to use (MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE may be set)."] const MAV_BATTERY_STATUS_FLAGS_CELL_BALANCING = 4 ; # [doc = "Battery cells are not balanced. Not ready to use."] const MAV_BATTERY_STATUS_FLAGS_FAULT_CELL_IMBALANCE = 8 ; # [doc = "Battery is auto discharging (towards storage level). Not ready to use (MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE would be set)."] const MAV_BATTERY_STATUS_FLAGS_AUTO_DISCHARGING = 16 ; # [doc = "Battery requires service (not safe to fly). This is set at vendor discretion. It is likely to be set for most faults, and may also be set according to a maintenance schedule (such as age, or number of recharge cycles, etc.)."] const MAV_BATTERY_STATUS_FLAGS_REQUIRES_SERVICE = 32 ; # [doc = "Battery is faulty and cannot be repaired (not safe to fly). This is set at vendor discretion. The battery should be disposed of safely."] const MAV_BATTERY_STATUS_FLAGS_BAD_BATTERY = 64 ; # [doc = "Automatic battery protection monitoring is enabled. When enabled, the system will monitor for certain kinds of faults, such as cells being over-voltage. If a fault is triggered then and protections are enabled then a safety fault (MAV_BATTERY_STATUS_FLAGS_FAULT_PROTECTION_SYSTEM) will be set and power from the battery will be stopped. Note that battery protection monitoring should only be enabled when the vehicle is landed. Once the vehicle is armed, or starts moving, the protections should be disabled to prevent false positives from disabling the output."] const MAV_BATTERY_STATUS_FLAGS_PROTECTIONS_ENABLED = 128 ; # [doc = "The battery fault protection system had detected a fault and cut all power from the battery. This will only trigger if MAV_BATTERY_STATUS_FLAGS_PROTECTIONS_ENABLED is set. Other faults like MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_VOLT may also be set, indicating the cause of the protection fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_PROTECTION_SYSTEM = 256 ; # [doc = "One or more cells are above their maximum voltage rating."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_VOLT = 512 ; # [doc = "One or more cells are below their minimum voltage rating. A battery that had deep-discharged might be irrepairably damaged, and set both MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_VOLT and MAV_BATTERY_STATUS_FLAGS_BAD_BATTERY."] const MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_VOLT = 1024 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_TEMPERATURE = 2048 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_UNDER_TEMPERATURE = 4096 ; # [doc = "Over-current fault."] const MAV_BATTERY_STATUS_FLAGS_FAULT_OVER_CURRENT = 8192 ; # [doc = "Short circuit event detected. The battery may or may not be safe to use (check other flags)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_SHORT_CIRCUIT = 16384 ; # [doc = "Voltage not compatible with power rail voltage (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_VOLTAGE = 32768 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_FIRMWARE = 65536 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const MAV_BATTERY_STATUS_FLAGS_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 131072 ; # [doc = "Battery capacity_consumed and capacity_remaining values are relative to a full battery (they sum to the total capacity of the battery). This flag would be set for a smart battery that can accurately determine its remaining charge across vehicle reboots and discharge/recharge cycles. If unset the capacity_consumed indicates the consumption since vehicle power-on, as measured using a power monitor. The capacity_remaining, if provided, indicates the estimated remaining capacity on the assumption that the battery was full on vehicle boot. If unset a GCS is recommended to advise that users fully charge the battery on power on."] const MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL = 262144 ; # [doc = "Reserved (not used). If set, this will indicate that an additional status field exists for higher status values."] const MAV_BATTERY_STATUS_FLAGS_EXTENDED = 2147483648 ; } }
1495impl MavBatteryStatusFlags {
1496 pub const DEFAULT: Self = Self::MAV_BATTERY_STATUS_FLAGS_NOT_READY_TO_USE;
1497}
1498impl Default for MavBatteryStatusFlags {
1499 fn default() -> Self {
1500 Self::DEFAULT
1501 }
1502}
1503#[cfg_attr(feature = "ts", derive(TS))]
1504#[cfg_attr(feature = "ts", ts(export))]
1505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1507#[cfg_attr(feature = "serde", serde(tag = "type"))]
1508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1509#[repr(u32)]
1510#[doc = "Enumeration of battery types"]
1511pub enum MavBatteryType {
1512 #[doc = "Not specified."]
1513 MAV_BATTERY_TYPE_UNKNOWN = 0,
1514 #[doc = "Lithium polymer battery"]
1515 MAV_BATTERY_TYPE_LIPO = 1,
1516 #[doc = "Lithium-iron-phosphate battery"]
1517 MAV_BATTERY_TYPE_LIFE = 2,
1518 #[doc = "Lithium-ION battery"]
1519 MAV_BATTERY_TYPE_LION = 3,
1520 #[doc = "Nickel metal hydride battery"]
1521 MAV_BATTERY_TYPE_NIMH = 4,
1522}
1523impl MavBatteryType {
1524 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1525}
1526impl Default for MavBatteryType {
1527 fn default() -> Self {
1528 Self::DEFAULT
1529 }
1530}
1531#[cfg_attr(feature = "ts", derive(TS))]
1532#[cfg_attr(feature = "ts", ts(export))]
1533#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1535#[cfg_attr(feature = "serde", serde(tag = "type"))]
1536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1537#[repr(u32)]
1538#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1539pub enum MavCmd {
1540 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1541 MAV_CMD_NAV_WAYPOINT = 16,
1542 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1543 MAV_CMD_NAV_LOITER_UNLIM = 17,
1544 #[doc = "Loiter around this waypoint for X turns"]
1545 MAV_CMD_NAV_LOITER_TURNS = 18,
1546 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1547 MAV_CMD_NAV_LOITER_TIME = 19,
1548 #[doc = "Return to launch location"]
1549 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1550 #[doc = "Land at location."]
1551 MAV_CMD_NAV_LAND = 21,
1552 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1553 MAV_CMD_NAV_TAKEOFF = 22,
1554 #[doc = "Land at local position (local frame only)"]
1555 MAV_CMD_NAV_LAND_LOCAL = 23,
1556 #[doc = "Takeoff from local position (local frame only)"]
1557 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1558 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1559 MAV_CMD_NAV_FOLLOW = 25,
1560 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1561 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1562 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1563 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1564 #[doc = "Begin following a target"]
1565 MAV_CMD_DO_FOLLOW = 32,
1566 #[doc = "Reposition the MAV after a follow target command has been sent"]
1567 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1568 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1569 MAV_CMD_DO_ORBIT = 34,
1570 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1571 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1572 MAV_CMD_NAV_ROI = 80,
1573 #[doc = "Control autonomous path planning on the MAV."]
1574 MAV_CMD_NAV_PATHPLANNING = 81,
1575 #[doc = "Navigate to waypoint using a spline path."]
1576 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1577 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1578 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1579 #[doc = "Land using VTOL mode"]
1580 MAV_CMD_NAV_VTOL_LAND = 85,
1581 #[doc = "hand control over to an external controller"]
1582 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1583 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1584 MAV_CMD_NAV_DELAY = 93,
1585 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1586 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1587 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1588 MAV_CMD_NAV_LAST = 95,
1589 #[doc = "Delay mission state machine."]
1590 MAV_CMD_CONDITION_DELAY = 112,
1591 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1592 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1593 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1594 MAV_CMD_CONDITION_DISTANCE = 114,
1595 #[doc = "Reach a certain target angle."]
1596 MAV_CMD_CONDITION_YAW = 115,
1597 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1598 MAV_CMD_CONDITION_LAST = 159,
1599 #[doc = "Set system mode."]
1600 MAV_CMD_DO_SET_MODE = 176,
1601 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1602 MAV_CMD_DO_JUMP = 177,
1603 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1604 MAV_CMD_DO_CHANGE_SPEED = 178,
1605 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1606 MAV_CMD_DO_SET_HOME = 179,
1607 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1608 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1609 MAV_CMD_DO_SET_PARAMETER = 180,
1610 #[doc = "Set a relay to a condition."]
1611 MAV_CMD_DO_SET_RELAY = 181,
1612 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1613 MAV_CMD_DO_REPEAT_RELAY = 182,
1614 #[doc = "Set a servo to a desired PWM value."]
1615 MAV_CMD_DO_SET_SERVO = 183,
1616 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1617 MAV_CMD_DO_REPEAT_SERVO = 184,
1618 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1619 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1620 #[doc = "Change altitude set point."]
1621 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1622 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1623 MAV_CMD_DO_SET_ACTUATOR = 187,
1624 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1625 MAV_CMD_DO_RETURN_PATH_START = 188,
1626 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1627 MAV_CMD_DO_LAND_START = 189,
1628 #[doc = "Mission command to perform a landing from a rally point."]
1629 MAV_CMD_DO_RALLY_LAND = 190,
1630 #[doc = "Mission command to safely abort an autonomous landing."]
1631 MAV_CMD_DO_GO_AROUND = 191,
1632 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1633 MAV_CMD_DO_REPOSITION = 192,
1634 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1635 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1636 #[doc = "Set moving direction to forward or reverse."]
1637 MAV_CMD_DO_SET_REVERSE = 194,
1638 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1639 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1640 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1641 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1642 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1643 MAV_CMD_DO_SET_ROI_NONE = 197,
1644 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1645 MAV_CMD_DO_SET_ROI_SYSID = 198,
1646 #[doc = "Control onboard camera system."]
1647 MAV_CMD_DO_CONTROL_VIDEO = 200,
1648 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1649 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1650 MAV_CMD_DO_SET_ROI = 201,
1651 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1652 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1653 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1654 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1655 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1656 #[doc = "Mission command to configure a camera or antenna mount"]
1657 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1658 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1659 #[doc = "Mission command to control a camera or antenna mount"]
1660 MAV_CMD_DO_MOUNT_CONTROL = 205,
1661 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1662 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1663 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1664 MAV_CMD_DO_FENCE_ENABLE = 207,
1665 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1666 MAV_CMD_DO_PARACHUTE = 208,
1667 #[doc = "Command to perform motor test."]
1668 MAV_CMD_DO_MOTOR_TEST = 209,
1669 #[doc = "Change to/from inverted flight."]
1670 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1671 #[doc = "Mission command to operate a gripper."]
1672 MAV_CMD_DO_GRIPPER = 211,
1673 #[doc = "Enable/disable autotune."]
1674 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1675 #[doc = "Sets a desired vehicle turn angle and speed change."]
1676 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1677 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1678 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1679 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1680 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1681 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1682 #[doc = "set id of master controller"]
1683 MAV_CMD_DO_GUIDED_MASTER = 221,
1684 #[doc = "Set limits for external control"]
1685 MAV_CMD_DO_GUIDED_LIMITS = 222,
1686 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1687 MAV_CMD_DO_ENGINE_CONTROL = 223,
1688 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1689 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1690 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1691 MAV_CMD_DO_LAST = 240,
1692 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1693 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1694 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1695 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1696 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1697 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1698 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1699 MAV_CMD_PREFLIGHT_STORAGE = 245,
1700 #[doc = "Request the reboot or shutdown of system components."]
1701 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1702 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1703 MAV_CMD_OVERRIDE_GOTO = 252,
1704 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1705 MAV_CMD_OBLIQUE_SURVEY = 260,
1706 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1707 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1708 #[doc = "start running a mission"]
1709 MAV_CMD_MISSION_START = 300,
1710 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1711 MAV_CMD_ACTUATOR_TEST = 310,
1712 #[doc = "Actuator configuration command."]
1713 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1714 #[doc = "Arms / Disarms a component"]
1715 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1716 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1717 MAV_CMD_RUN_PREARM_CHECKS = 401,
1718 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1719 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1720 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1721 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1722 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1723 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1724 MAV_CMD_GET_HOME_POSITION = 410,
1725 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1726 MAV_CMD_INJECT_FAILURE = 420,
1727 #[doc = "Starts receiver pairing."]
1728 MAV_CMD_START_RX_PAIR = 500,
1729 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1730 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1731 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1732 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1733 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1734 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1735 MAV_CMD_REQUEST_MESSAGE = 512,
1736 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1737 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1738 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1739 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1740 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1741 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1742 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1743 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1744 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1745 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1746 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1747 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1748 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1749 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1750 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1751 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1752 MAV_CMD_STORAGE_FORMAT = 526,
1753 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1754 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1755 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1756 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1757 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1758 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1759 #[doc = "Reset all camera settings to Factory Default"]
1760 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1761 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1762 MAV_CMD_SET_CAMERA_MODE = 530,
1763 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1764 MAV_CMD_SET_CAMERA_ZOOM = 531,
1765 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1766 MAV_CMD_SET_CAMERA_FOCUS = 532,
1767 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1768 MAV_CMD_SET_STORAGE_USAGE = 533,
1769 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1770 MAV_CMD_SET_CAMERA_SOURCE = 534,
1771 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1772 MAV_CMD_JUMP_TAG = 600,
1773 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1774 MAV_CMD_DO_JUMP_TAG = 601,
1775 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1776 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1777 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1778 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1779 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1780 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1781 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1782 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1783 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1784 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1785 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1786 #[doc = "Enable or disable on-board camera triggering system."]
1787 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1788 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1789 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1790 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1791 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1792 #[doc = "Stops ongoing tracking."]
1793 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1794 #[doc = "Starts video capture (recording)."]
1795 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1796 #[doc = "Stop the current video capture (recording)."]
1797 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1798 #[doc = "Start video streaming"]
1799 MAV_CMD_VIDEO_START_STREAMING = 2502,
1800 #[doc = "Stop the given video stream"]
1801 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1802 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1803 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1804 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1805 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1806 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1807 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1808 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1809 MAV_CMD_LOGGING_START = 2510,
1810 #[doc = "Request to stop streaming log data over MAVLink"]
1811 MAV_CMD_LOGGING_STOP = 2511,
1812 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1813 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1814 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1815 #[doc = "Create a panorama at the current position"]
1816 MAV_CMD_PANORAMA_CREATE = 2800,
1817 #[doc = "Request VTOL transition"]
1818 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1819 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1820 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1821 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1822 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1823 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1824 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1825 #[doc = "Delay mission state machine until gate has been reached."]
1826 MAV_CMD_CONDITION_GATE = 4501,
1827 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1828 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1829 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1830 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1831 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1832 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1833 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1834 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1835 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1836 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1837 #[doc = "Rally point. You can have multiple rally points defined."]
1838 MAV_CMD_NAV_RALLY_POINT = 5100,
1839 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1840 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1841 #[doc = "Change state of safety switch."]
1842 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1843 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1844 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1845 #[deprecated = " (Deprecated since 2021-06)"]
1846 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1847 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1848 #[deprecated = " (Deprecated since 2021-06)"]
1849 #[doc = "Control the payload deployment."]
1850 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1851 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1852 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1853 #[doc = "Command to operate winch."]
1854 MAV_CMD_DO_WINCH = 42600,
1855 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1856 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1857 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1858 MAV_CMD_WAYPOINT_USER_1 = 31000,
1859 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1860 MAV_CMD_WAYPOINT_USER_2 = 31001,
1861 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1862 MAV_CMD_WAYPOINT_USER_3 = 31002,
1863 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1864 MAV_CMD_WAYPOINT_USER_4 = 31003,
1865 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1866 MAV_CMD_WAYPOINT_USER_5 = 31004,
1867 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1868 MAV_CMD_SPATIAL_USER_1 = 31005,
1869 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1870 MAV_CMD_SPATIAL_USER_2 = 31006,
1871 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1872 MAV_CMD_SPATIAL_USER_3 = 31007,
1873 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1874 MAV_CMD_SPATIAL_USER_4 = 31008,
1875 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1876 MAV_CMD_SPATIAL_USER_5 = 31009,
1877 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1878 MAV_CMD_USER_1 = 31010,
1879 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1880 MAV_CMD_USER_2 = 31011,
1881 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1882 MAV_CMD_USER_3 = 31012,
1883 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1884 MAV_CMD_USER_4 = 31013,
1885 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1886 MAV_CMD_USER_5 = 31014,
1887 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1888 MAV_CMD_CAN_FORWARD = 32000,
1889 #[doc = "Fly a figure eight path as defined by the parameters. Set parameters to NaN/INT32_MAX (as appropriate) to use system-default values. The command is intended for fixed wing vehicles (and VTOL hybrids flying in fixed-wing mode), allowing POI tracking for gimbals that don't support infinite rotation. This command only defines the flight path. Speed should be set independently (use e.g. MAV_CMD_DO_CHANGE_SPEED). Yaw and other degrees of freedom are not specified, and will be flight-stack specific (on vehicles where they can be controlled independent of the heading)."]
1890 MAV_CMD_DO_FIGURE_EIGHT = 35,
1891 #[doc = "Request a target system to start an upgrade of one (or all) of its components. For example, the command might be sent to a companion computer to cause it to upgrade a connected flight controller. The system doing the upgrade will report progress using the normal command protocol sequence for a long running operation. Command protocol information: <https://mavlink.io/en/services/command.html>."]
1892 MAV_CMD_DO_UPGRADE = 247,
1893 #[doc = "Allows setting an AT S command of an SiK radio."]
1894 MAV_CMD_SET_AT_S_PARAM = 550,
1895 #[doc = "Set system and component id. This allows moving of a system and all its components to a new system id, or moving a particular component to a new system/component id. Recipients must reject command addressed to broadcast system ID."]
1896 MAV_CMD_DO_SET_SYS_CMP_ID = 610,
1897 #[doc = "Sets the GNSS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GNSS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor. This command supersedes SET_GPS_GLOBAL_ORIGIN. Should be sent in a COMMAND_INT (Expected frame is MAV_FRAME_GLOBAL, and this should be assumed when sent in COMMAND_LONG)."]
1898 MAV_CMD_DO_SET_GLOBAL_ORIGIN = 611,
1899 #[doc = "Used to manually set/unset emergency status for remote id. This is for compliance with MOC ASTM docs, specifically F358 section 7.7: \"Emergency Status Indicator\". The requirement can also be satisfied by automatic setting of the emergency status by flight stack, and that approach is preferred. See <https://mavlink.io/en/services/opendroneid.html> for more information."]
1900 MAV_CMD_ODID_SET_EMERGENCY = 12900,
1901 #[doc = "Set an external estimate of wind direction and speed. This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself."]
1902 MAV_CMD_EXTERNAL_WIND_ESTIMATE = 43004,
1903 #[doc = "Request GCS control of a system (or of a specific component in a system). A controlled system should only accept MAVLink commands and command-like messages that are sent by its controlling GCS, or from other components with the same system id. Commands from other systems should be rejected with MAV_RESULT_FAILED (except for this command, which may be acknowledged with MAV_RESULT_ACCEPTED if control is granted). Command-like messages should be ignored (or rejected if that is supported by their associated protocol). GCS control of the whole system is managed via a single component that we will refer to here as the \"system manager component\". This component streams the CONTROL_STATUS message and sets the GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER flag. Other components in the system should monitor for the CONTROL_STATUS message with this flag, and set their controlling GCS to match its published system id. A GCS that wants to control the system should also monitor for the same message and flag, and address the MAV_CMD_REQUEST_OPERATOR_CONTROL to its component id. Note that integrators are required to ensure that there is only one system manager component in the system (i.e. one component emitting the message with GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER set). The MAV_CMD_REQUEST_OPERATOR_CONTROL command is sent by a GCS to the system manager component to request or release control of a system, specifying whether subsequent takeover requests from another GCS are automatically granted, or require permission. The system manager component should grant control to the GCS if the system does not require takeover permission (or is uncontrolled) and ACK the request with MAV_RESULT_ACCEPTED. The system manager component should then stream CONTROL_STATUS indicating its controlling system: all other components with the same system id should monitor this message and set their own controlling GCS to match that of the system manager component. If the system manager component cannot grant control (because takeover requires permission), the request should be rejected with MAV_RESULT_FAILED. The system manager component should then send this same command to the current owning GCS in order to notify of the request. The owning GCS would ACK with MAV_RESULT_ACCEPTED, and might choose to release control of the vehicle, or re-request control with the takeover bit set to allow permission. In case it choses to re-request control with takeover bit set to allow permission, requestor GCS will only have 10 seconds to get control, otherwise owning GCS will re-request control with takeover bit set to disallow permission, and requestor GCS will need repeat the request if still interested in getting control. Note that the pilots of both GCS should co-ordinate safe handover offline. Note that in most systems the only controlled component will be the \"system manager component\", and that will be the autopilot. However separate GCS control of a particular component is also permitted, if supported by the component. In this case the GCS will address MAV_CMD_REQUEST_OPERATOR_CONTROL to the specific component it wants to control. The component will then stream CONTROL_STATUS for its controlling GCS (it must not set GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER). The component should fall back to the system GCS (if any) when it is not directly controlled, and may stop emitting CONTROL_STATUS. The flow is otherwise the same as for requesting control over the whole system."]
1904 MAV_CMD_REQUEST_OPERATOR_CONTROL = 32100,
1905}
1906impl MavCmd {
1907 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1908}
1909impl Default for MavCmd {
1910 fn default() -> Self {
1911 Self::DEFAULT
1912 }
1913}
1914#[cfg_attr(feature = "ts", derive(TS))]
1915#[cfg_attr(feature = "ts", ts(export))]
1916#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1918#[cfg_attr(feature = "serde", serde(tag = "type"))]
1919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1920#[repr(u32)]
1921#[doc = "Possible actions an aircraft can take to avoid a collision."]
1922pub enum MavCollisionAction {
1923 #[doc = "Ignore any potential collisions"]
1924 MAV_COLLISION_ACTION_NONE = 0,
1925 #[doc = "Report potential collision"]
1926 MAV_COLLISION_ACTION_REPORT = 1,
1927 #[doc = "Ascend or Descend to avoid threat"]
1928 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1929 #[doc = "Move horizontally to avoid threat"]
1930 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1931 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1932 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1933 #[doc = "Aircraft to fly directly back to its launch point"]
1934 MAV_COLLISION_ACTION_RTL = 5,
1935 #[doc = "Aircraft to stop in place"]
1936 MAV_COLLISION_ACTION_HOVER = 6,
1937}
1938impl MavCollisionAction {
1939 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1940}
1941impl Default for MavCollisionAction {
1942 fn default() -> Self {
1943 Self::DEFAULT
1944 }
1945}
1946#[cfg_attr(feature = "ts", derive(TS))]
1947#[cfg_attr(feature = "ts", ts(export))]
1948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1950#[cfg_attr(feature = "serde", serde(tag = "type"))]
1951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1952#[repr(u32)]
1953#[doc = "Source of information about this collision."]
1954pub enum MavCollisionSrc {
1955 #[doc = "ID field references ADSB_VEHICLE packets"]
1956 MAV_COLLISION_SRC_ADSB = 0,
1957 #[doc = "ID field references MAVLink SRC ID"]
1958 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1959}
1960impl MavCollisionSrc {
1961 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1962}
1963impl Default for MavCollisionSrc {
1964 fn default() -> Self {
1965 Self::DEFAULT
1966 }
1967}
1968#[cfg_attr(feature = "ts", derive(TS))]
1969#[cfg_attr(feature = "ts", ts(export))]
1970#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1972#[cfg_attr(feature = "serde", serde(tag = "type"))]
1973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1974#[repr(u32)]
1975#[doc = "Aircraft-rated danger from this threat."]
1976pub enum MavCollisionThreatLevel {
1977 #[doc = "Not a threat"]
1978 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1979 #[doc = "Craft is mildly concerned about this threat"]
1980 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1981 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1982 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1983}
1984impl MavCollisionThreatLevel {
1985 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1986}
1987impl Default for MavCollisionThreatLevel {
1988 fn default() -> Self {
1989 Self::DEFAULT
1990 }
1991}
1992#[cfg_attr(feature = "ts", derive(TS))]
1993#[cfg_attr(feature = "ts", ts(export))]
1994#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1996#[cfg_attr(feature = "serde", serde(tag = "type"))]
1997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1998#[repr(u32)]
1999#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
2000pub enum MavComponent {
2001 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
2002 MAV_COMP_ID_ALL = 0,
2003 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
2004 MAV_COMP_ID_AUTOPILOT1 = 1,
2005 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2006 MAV_COMP_ID_USER1 = 25,
2007 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2008 MAV_COMP_ID_USER2 = 26,
2009 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2010 MAV_COMP_ID_USER3 = 27,
2011 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2012 MAV_COMP_ID_USER4 = 28,
2013 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2014 MAV_COMP_ID_USER5 = 29,
2015 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2016 MAV_COMP_ID_USER6 = 30,
2017 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2018 MAV_COMP_ID_USER7 = 31,
2019 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2020 MAV_COMP_ID_USER8 = 32,
2021 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2022 MAV_COMP_ID_USER9 = 33,
2023 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2024 MAV_COMP_ID_USER10 = 34,
2025 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2026 MAV_COMP_ID_USER11 = 35,
2027 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2028 MAV_COMP_ID_USER12 = 36,
2029 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2030 MAV_COMP_ID_USER13 = 37,
2031 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2032 MAV_COMP_ID_USER14 = 38,
2033 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2034 MAV_COMP_ID_USER15 = 39,
2035 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2036 MAV_COMP_ID_USER16 = 40,
2037 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2038 MAV_COMP_ID_USER17 = 41,
2039 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2040 MAV_COMP_ID_USER18 = 42,
2041 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2042 MAV_COMP_ID_USER19 = 43,
2043 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2044 MAV_COMP_ID_USER20 = 44,
2045 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2046 MAV_COMP_ID_USER21 = 45,
2047 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2048 MAV_COMP_ID_USER22 = 46,
2049 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2050 MAV_COMP_ID_USER23 = 47,
2051 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2052 MAV_COMP_ID_USER24 = 48,
2053 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2054 MAV_COMP_ID_USER25 = 49,
2055 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2056 MAV_COMP_ID_USER26 = 50,
2057 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2058 MAV_COMP_ID_USER27 = 51,
2059 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2060 MAV_COMP_ID_USER28 = 52,
2061 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2062 MAV_COMP_ID_USER29 = 53,
2063 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2064 MAV_COMP_ID_USER30 = 54,
2065 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2066 MAV_COMP_ID_USER31 = 55,
2067 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2068 MAV_COMP_ID_USER32 = 56,
2069 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2070 MAV_COMP_ID_USER33 = 57,
2071 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2072 MAV_COMP_ID_USER34 = 58,
2073 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2074 MAV_COMP_ID_USER35 = 59,
2075 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2076 MAV_COMP_ID_USER36 = 60,
2077 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2078 MAV_COMP_ID_USER37 = 61,
2079 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2080 MAV_COMP_ID_USER38 = 62,
2081 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2082 MAV_COMP_ID_USER39 = 63,
2083 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2084 MAV_COMP_ID_USER40 = 64,
2085 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2086 MAV_COMP_ID_USER41 = 65,
2087 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2088 MAV_COMP_ID_USER42 = 66,
2089 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2090 MAV_COMP_ID_USER43 = 67,
2091 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
2092 MAV_COMP_ID_TELEMETRY_RADIO = 68,
2093 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2094 MAV_COMP_ID_USER45 = 69,
2095 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2096 MAV_COMP_ID_USER46 = 70,
2097 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2098 MAV_COMP_ID_USER47 = 71,
2099 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2100 MAV_COMP_ID_USER48 = 72,
2101 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2102 MAV_COMP_ID_USER49 = 73,
2103 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2104 MAV_COMP_ID_USER50 = 74,
2105 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2106 MAV_COMP_ID_USER51 = 75,
2107 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2108 MAV_COMP_ID_USER52 = 76,
2109 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2110 MAV_COMP_ID_USER53 = 77,
2111 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2112 MAV_COMP_ID_USER54 = 78,
2113 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2114 MAV_COMP_ID_USER55 = 79,
2115 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2116 MAV_COMP_ID_USER56 = 80,
2117 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2118 MAV_COMP_ID_USER57 = 81,
2119 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2120 MAV_COMP_ID_USER58 = 82,
2121 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2122 MAV_COMP_ID_USER59 = 83,
2123 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2124 MAV_COMP_ID_USER60 = 84,
2125 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2126 MAV_COMP_ID_USER61 = 85,
2127 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2128 MAV_COMP_ID_USER62 = 86,
2129 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2130 MAV_COMP_ID_USER63 = 87,
2131 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2132 MAV_COMP_ID_USER64 = 88,
2133 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2134 MAV_COMP_ID_USER65 = 89,
2135 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2136 MAV_COMP_ID_USER66 = 90,
2137 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2138 MAV_COMP_ID_USER67 = 91,
2139 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2140 MAV_COMP_ID_USER68 = 92,
2141 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2142 MAV_COMP_ID_USER69 = 93,
2143 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2144 MAV_COMP_ID_USER70 = 94,
2145 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2146 MAV_COMP_ID_USER71 = 95,
2147 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2148 MAV_COMP_ID_USER72 = 96,
2149 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2150 MAV_COMP_ID_USER73 = 97,
2151 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2152 MAV_COMP_ID_USER74 = 98,
2153 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2154 MAV_COMP_ID_USER75 = 99,
2155 #[doc = "Camera #1."]
2156 MAV_COMP_ID_CAMERA = 100,
2157 #[doc = "Camera #2."]
2158 MAV_COMP_ID_CAMERA2 = 101,
2159 #[doc = "Camera #3."]
2160 MAV_COMP_ID_CAMERA3 = 102,
2161 #[doc = "Camera #4."]
2162 MAV_COMP_ID_CAMERA4 = 103,
2163 #[doc = "Camera #5."]
2164 MAV_COMP_ID_CAMERA5 = 104,
2165 #[doc = "Camera #6."]
2166 MAV_COMP_ID_CAMERA6 = 105,
2167 #[doc = "Servo #1."]
2168 MAV_COMP_ID_SERVO1 = 140,
2169 #[doc = "Servo #2."]
2170 MAV_COMP_ID_SERVO2 = 141,
2171 #[doc = "Servo #3."]
2172 MAV_COMP_ID_SERVO3 = 142,
2173 #[doc = "Servo #4."]
2174 MAV_COMP_ID_SERVO4 = 143,
2175 #[doc = "Servo #5."]
2176 MAV_COMP_ID_SERVO5 = 144,
2177 #[doc = "Servo #6."]
2178 MAV_COMP_ID_SERVO6 = 145,
2179 #[doc = "Servo #7."]
2180 MAV_COMP_ID_SERVO7 = 146,
2181 #[doc = "Servo #8."]
2182 MAV_COMP_ID_SERVO8 = 147,
2183 #[doc = "Servo #9."]
2184 MAV_COMP_ID_SERVO9 = 148,
2185 #[doc = "Servo #10."]
2186 MAV_COMP_ID_SERVO10 = 149,
2187 #[doc = "Servo #11."]
2188 MAV_COMP_ID_SERVO11 = 150,
2189 #[doc = "Servo #12."]
2190 MAV_COMP_ID_SERVO12 = 151,
2191 #[doc = "Servo #13."]
2192 MAV_COMP_ID_SERVO13 = 152,
2193 #[doc = "Servo #14."]
2194 MAV_COMP_ID_SERVO14 = 153,
2195 #[doc = "Gimbal #1."]
2196 MAV_COMP_ID_GIMBAL = 154,
2197 #[doc = "Logging component."]
2198 MAV_COMP_ID_LOG = 155,
2199 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2200 MAV_COMP_ID_ADSB = 156,
2201 #[doc = "On Screen Display (OSD) devices for video links."]
2202 MAV_COMP_ID_OSD = 157,
2203 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2204 MAV_COMP_ID_PERIPHERAL = 158,
2205 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2206 #[doc = "Gimbal ID for QX1."]
2207 MAV_COMP_ID_QX1_GIMBAL = 159,
2208 #[doc = "FLARM collision alert component."]
2209 MAV_COMP_ID_FLARM = 160,
2210 #[doc = "Parachute component."]
2211 MAV_COMP_ID_PARACHUTE = 161,
2212 #[doc = "Winch component."]
2213 MAV_COMP_ID_WINCH = 169,
2214 #[doc = "Gimbal #2."]
2215 MAV_COMP_ID_GIMBAL2 = 171,
2216 #[doc = "Gimbal #3."]
2217 MAV_COMP_ID_GIMBAL3 = 172,
2218 #[doc = "Gimbal #4"]
2219 MAV_COMP_ID_GIMBAL4 = 173,
2220 #[doc = "Gimbal #5."]
2221 MAV_COMP_ID_GIMBAL5 = 174,
2222 #[doc = "Gimbal #6."]
2223 MAV_COMP_ID_GIMBAL6 = 175,
2224 #[doc = "Battery #1."]
2225 MAV_COMP_ID_BATTERY = 180,
2226 #[doc = "Battery #2."]
2227 MAV_COMP_ID_BATTERY2 = 181,
2228 #[doc = "CAN over MAVLink client."]
2229 MAV_COMP_ID_MAVCAN = 189,
2230 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2231 MAV_COMP_ID_MISSIONPLANNER = 190,
2232 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2233 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2234 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2235 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2236 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2237 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2238 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2239 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2240 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2241 MAV_COMP_ID_PATHPLANNER = 195,
2242 #[doc = "Component that plans a collision free path between two points."]
2243 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2244 #[doc = "Component that provides position estimates using VIO techniques."]
2245 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2246 #[doc = "Component that manages pairing of vehicle and GCS."]
2247 MAV_COMP_ID_PAIRING_MANAGER = 198,
2248 #[doc = "Inertial Measurement Unit (IMU) #1."]
2249 MAV_COMP_ID_IMU = 200,
2250 #[doc = "Inertial Measurement Unit (IMU) #2."]
2251 MAV_COMP_ID_IMU_2 = 201,
2252 #[doc = "Inertial Measurement Unit (IMU) #3."]
2253 MAV_COMP_ID_IMU_3 = 202,
2254 #[doc = "GPS #1."]
2255 MAV_COMP_ID_GPS = 220,
2256 #[doc = "GPS #2."]
2257 MAV_COMP_ID_GPS2 = 221,
2258 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2259 MAV_COMP_ID_ODID_TXRX_1 = 236,
2260 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2261 MAV_COMP_ID_ODID_TXRX_2 = 237,
2262 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2263 MAV_COMP_ID_ODID_TXRX_3 = 238,
2264 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2265 MAV_COMP_ID_UDP_BRIDGE = 240,
2266 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2267 MAV_COMP_ID_UART_BRIDGE = 241,
2268 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2269 MAV_COMP_ID_TUNNEL_NODE = 242,
2270 #[doc = "Illuminator"]
2271 MAV_COMP_ID_ILLUMINATOR = 243,
2272 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2273 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2274 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2275}
2276impl MavComponent {
2277 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2278}
2279impl Default for MavComponent {
2280 fn default() -> Self {
2281 Self::DEFAULT
2282 }
2283}
2284#[cfg_attr(feature = "ts", derive(TS))]
2285#[cfg_attr(feature = "ts", ts(export))]
2286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2288#[cfg_attr(feature = "serde", serde(tag = "type"))]
2289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2290#[repr(u32)]
2291#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2292#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2293pub enum MavDataStream {
2294 #[doc = "Enable all data streams"]
2295 MAV_DATA_STREAM_ALL = 0,
2296 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2297 MAV_DATA_STREAM_RAW_SENSORS = 1,
2298 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2299 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2300 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2301 MAV_DATA_STREAM_RC_CHANNELS = 3,
2302 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2303 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2304 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2305 MAV_DATA_STREAM_POSITION = 6,
2306 #[doc = "Dependent on the autopilot"]
2307 MAV_DATA_STREAM_EXTRA1 = 10,
2308 #[doc = "Dependent on the autopilot"]
2309 MAV_DATA_STREAM_EXTRA2 = 11,
2310 #[doc = "Dependent on the autopilot"]
2311 MAV_DATA_STREAM_EXTRA3 = 12,
2312}
2313impl MavDataStream {
2314 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2315}
2316impl Default for MavDataStream {
2317 fn default() -> Self {
2318 Self::DEFAULT
2319 }
2320}
2321#[cfg_attr(feature = "ts", derive(TS))]
2322#[cfg_attr(feature = "ts", ts(export))]
2323#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2325#[cfg_attr(feature = "serde", serde(tag = "type"))]
2326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2327#[repr(u32)]
2328#[doc = "Enumeration of distance sensor types"]
2329pub enum MavDistanceSensor {
2330 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2331 MAV_DISTANCE_SENSOR_LASER = 0,
2332 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2333 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2334 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2335 MAV_DISTANCE_SENSOR_INFRARED = 2,
2336 #[doc = "Radar type, e.g. uLanding units"]
2337 MAV_DISTANCE_SENSOR_RADAR = 3,
2338 #[doc = "Broken or unknown type, e.g. analog units"]
2339 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2340}
2341impl MavDistanceSensor {
2342 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2343}
2344impl Default for MavDistanceSensor {
2345 fn default() -> Self {
2346 Self::DEFAULT
2347 }
2348}
2349#[cfg_attr(feature = "ts", derive(TS))]
2350#[cfg_attr(feature = "ts", ts(export))]
2351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2353#[cfg_attr(feature = "serde", serde(tag = "type"))]
2354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2355#[repr(u32)]
2356#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2357pub enum MavDoRepositionFlags {
2358 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2359 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2360}
2361impl MavDoRepositionFlags {
2362 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2363}
2364impl Default for MavDoRepositionFlags {
2365 fn default() -> Self {
2366 Self::DEFAULT
2367 }
2368}
2369#[cfg_attr(feature = "ts", derive(TS))]
2370#[cfg_attr(feature = "ts", ts(export))]
2371#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2373#[cfg_attr(feature = "serde", serde(tag = "type"))]
2374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2375#[repr(u32)]
2376#[doc = "Enumeration of estimator types"]
2377pub enum MavEstimatorType {
2378 #[doc = "Unknown type of the estimator."]
2379 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2380 #[doc = "This is a naive estimator without any real covariance feedback."]
2381 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2382 #[doc = "Computer vision based estimate. Might be up to scale."]
2383 MAV_ESTIMATOR_TYPE_VISION = 2,
2384 #[doc = "Visual-inertial estimate."]
2385 MAV_ESTIMATOR_TYPE_VIO = 3,
2386 #[doc = "Plain GPS estimate."]
2387 MAV_ESTIMATOR_TYPE_GPS = 4,
2388 #[doc = "Estimator integrating GPS and inertial sensing."]
2389 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2390 #[doc = "Estimate from external motion capturing system."]
2391 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2392 #[doc = "Estimator based on lidar sensor input."]
2393 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2394 #[doc = "Estimator on autopilot."]
2395 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2396}
2397impl MavEstimatorType {
2398 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2399}
2400impl Default for MavEstimatorType {
2401 fn default() -> Self {
2402 Self::DEFAULT
2403 }
2404}
2405#[cfg_attr(feature = "ts", derive(TS))]
2406#[cfg_attr(feature = "ts", ts(export))]
2407#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2409#[cfg_attr(feature = "serde", serde(tag = "type"))]
2410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2411#[repr(u32)]
2412#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2413pub enum MavEventCurrentSequenceFlags {
2414 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2415 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2416}
2417impl MavEventCurrentSequenceFlags {
2418 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2419}
2420impl Default for MavEventCurrentSequenceFlags {
2421 fn default() -> Self {
2422 Self::DEFAULT
2423 }
2424}
2425#[cfg_attr(feature = "ts", derive(TS))]
2426#[cfg_attr(feature = "ts", ts(export))]
2427#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2429#[cfg_attr(feature = "serde", serde(tag = "type"))]
2430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2431#[repr(u32)]
2432#[doc = "Reason for an event error response."]
2433pub enum MavEventErrorReason {
2434 #[doc = "The requested event is not available (anymore)."]
2435 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2436}
2437impl MavEventErrorReason {
2438 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2439}
2440impl Default for MavEventErrorReason {
2441 fn default() -> Self {
2442 Self::DEFAULT
2443 }
2444}
2445#[cfg_attr(feature = "ts", derive(TS))]
2446#[cfg_attr(feature = "ts", ts(export))]
2447#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2449#[cfg_attr(feature = "serde", serde(tag = "type"))]
2450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2451#[repr(u32)]
2452#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2453pub enum MavFrame {
2454 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2455 MAV_FRAME_GLOBAL = 0,
2456 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2457 MAV_FRAME_LOCAL_NED = 1,
2458 #[doc = "NOT a coordinate frame, indicates a mission command."]
2459 MAV_FRAME_MISSION = 2,
2460 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2461 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2462 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2463 MAV_FRAME_LOCAL_ENU = 4,
2464 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2465 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2466 MAV_FRAME_GLOBAL_INT = 5,
2467 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2468 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2469 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2470 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2471 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2472 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2473 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2474 MAV_FRAME_BODY_NED = 8,
2475 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2476 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2477 MAV_FRAME_BODY_OFFSET_NED = 9,
2478 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2479 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2480 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2481 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2482 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2483 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2484 MAV_FRAME_BODY_FRD = 12,
2485 #[deprecated = " (Deprecated since 2019-04)"]
2486 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2487 MAV_FRAME_RESERVED_13 = 13,
2488 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2489 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2490 MAV_FRAME_RESERVED_14 = 14,
2491 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2492 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2493 MAV_FRAME_RESERVED_15 = 15,
2494 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2495 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2496 MAV_FRAME_RESERVED_16 = 16,
2497 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2498 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2499 MAV_FRAME_RESERVED_17 = 17,
2500 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2501 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2502 MAV_FRAME_RESERVED_18 = 18,
2503 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2504 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2505 MAV_FRAME_RESERVED_19 = 19,
2506 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2507 MAV_FRAME_LOCAL_FRD = 20,
2508 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2509 MAV_FRAME_LOCAL_FLU = 21,
2510}
2511impl MavFrame {
2512 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2513}
2514impl Default for MavFrame {
2515 fn default() -> Self {
2516 Self::DEFAULT
2517 }
2518}
2519#[cfg_attr(feature = "ts", derive(TS))]
2520#[cfg_attr(feature = "ts", ts(export))]
2521#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2523#[cfg_attr(feature = "serde", serde(tag = "type"))]
2524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2525#[repr(u32)]
2526#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2527pub enum MavFtpErr {
2528 #[doc = "None: No error"]
2529 MAV_FTP_ERR_NONE = 0,
2530 #[doc = "Fail: Unknown failure"]
2531 MAV_FTP_ERR_FAIL = 1,
2532 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2533 MAV_FTP_ERR_FAILERRNO = 2,
2534 #[doc = "InvalidDataSize: Payload size is invalid"]
2535 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2536 #[doc = "InvalidSession: Session is not currently open"]
2537 MAV_FTP_ERR_INVALIDSESSION = 4,
2538 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2539 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2540 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2541 MAV_FTP_ERR_EOF = 6,
2542 #[doc = "UnknownCommand: Unknown command / opcode"]
2543 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2544 #[doc = "FileExists: File/directory already exists"]
2545 MAV_FTP_ERR_FILEEXISTS = 8,
2546 #[doc = "FileProtected: File/directory is write protected"]
2547 MAV_FTP_ERR_FILEPROTECTED = 9,
2548 #[doc = "FileNotFound: File/directory not found"]
2549 MAV_FTP_ERR_FILENOTFOUND = 10,
2550}
2551impl MavFtpErr {
2552 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2553}
2554impl Default for MavFtpErr {
2555 fn default() -> Self {
2556 Self::DEFAULT
2557 }
2558}
2559#[cfg_attr(feature = "ts", derive(TS))]
2560#[cfg_attr(feature = "ts", ts(export))]
2561#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2563#[cfg_attr(feature = "serde", serde(tag = "type"))]
2564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2565#[repr(u32)]
2566#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2567pub enum MavFtpOpcode {
2568 #[doc = "None. Ignored, always ACKed"]
2569 MAV_FTP_OPCODE_NONE = 0,
2570 #[doc = "TerminateSession: Terminates open Read session"]
2571 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2572 #[doc = "ResetSessions: Terminates all open read sessions"]
2573 MAV_FTP_OPCODE_RESETSESSION = 2,
2574 #[doc = "ListDirectory. List files and directories in path from offset"]
2575 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2576 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2577 MAV_FTP_OPCODE_OPENFILERO = 4,
2578 #[doc = "ReadFile: Reads size bytes from offset in session"]
2579 MAV_FTP_OPCODE_READFILE = 5,
2580 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2581 MAV_FTP_OPCODE_CREATEFILE = 6,
2582 #[doc = "WriteFile: Writes size bytes to offset in session"]
2583 MAV_FTP_OPCODE_WRITEFILE = 7,
2584 #[doc = "RemoveFile: Remove file at path"]
2585 MAV_FTP_OPCODE_REMOVEFILE = 8,
2586 #[doc = "CreateDirectory: Creates directory at path"]
2587 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2588 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2589 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2590 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2591 MAV_FTP_OPCODE_OPENFILEWO = 11,
2592 #[doc = "TruncateFile: Truncate file at path to offset length"]
2593 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2594 #[doc = "Rename: Rename path1 to path2"]
2595 MAV_FTP_OPCODE_RENAME = 13,
2596 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2597 MAV_FTP_OPCODE_CALCFILECRC = 14,
2598 #[doc = "BurstReadFile: Burst download session file"]
2599 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2600 #[doc = "ACK: ACK response"]
2601 MAV_FTP_OPCODE_ACK = 128,
2602 #[doc = "NAK: NAK response"]
2603 MAV_FTP_OPCODE_NAK = 129,
2604}
2605impl MavFtpOpcode {
2606 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2607}
2608impl Default for MavFtpOpcode {
2609 fn default() -> Self {
2610 Self::DEFAULT
2611 }
2612}
2613#[cfg_attr(feature = "ts", derive(TS))]
2614#[cfg_attr(feature = "ts", ts(export))]
2615#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2617#[cfg_attr(feature = "serde", serde(tag = "type"))]
2618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2619#[repr(u32)]
2620#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2621pub enum MavFuelType {
2622 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2623 MAV_FUEL_TYPE_UNKNOWN = 0,
2624 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2625 MAV_FUEL_TYPE_LIQUID = 1,
2626 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2627 MAV_FUEL_TYPE_GAS = 2,
2628}
2629impl MavFuelType {
2630 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2631}
2632impl Default for MavFuelType {
2633 fn default() -> Self {
2634 Self::DEFAULT
2635 }
2636}
2637bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2638impl MavGeneratorStatusFlag {
2639 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2640}
2641impl Default for MavGeneratorStatusFlag {
2642 fn default() -> Self {
2643 Self::DEFAULT
2644 }
2645}
2646#[cfg_attr(feature = "ts", derive(TS))]
2647#[cfg_attr(feature = "ts", ts(export))]
2648#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2650#[cfg_attr(feature = "serde", serde(tag = "type"))]
2651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2652#[repr(u32)]
2653#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2654pub enum MavGoto {
2655 #[doc = "Hold at the current position."]
2656 MAV_GOTO_DO_HOLD = 0,
2657 #[doc = "Continue with the next item in mission execution."]
2658 MAV_GOTO_DO_CONTINUE = 1,
2659 #[doc = "Hold at the current position of the system"]
2660 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2661 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2662 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2663}
2664impl MavGoto {
2665 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2666}
2667impl Default for MavGoto {
2668 fn default() -> Self {
2669 Self::DEFAULT
2670 }
2671}
2672#[cfg_attr(feature = "ts", derive(TS))]
2673#[cfg_attr(feature = "ts", ts(export))]
2674#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2676#[cfg_attr(feature = "serde", serde(tag = "type"))]
2677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2678#[repr(u32)]
2679#[doc = "Enumeration of landed detector states"]
2680pub enum MavLandedState {
2681 #[doc = "MAV landed state is unknown"]
2682 MAV_LANDED_STATE_UNDEFINED = 0,
2683 #[doc = "MAV is landed (on ground)"]
2684 MAV_LANDED_STATE_ON_GROUND = 1,
2685 #[doc = "MAV is in air"]
2686 MAV_LANDED_STATE_IN_AIR = 2,
2687 #[doc = "MAV currently taking off"]
2688 MAV_LANDED_STATE_TAKEOFF = 3,
2689 #[doc = "MAV currently landing"]
2690 MAV_LANDED_STATE_LANDING = 4,
2691}
2692impl MavLandedState {
2693 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2694}
2695impl Default for MavLandedState {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700#[cfg_attr(feature = "ts", derive(TS))]
2701#[cfg_attr(feature = "ts", ts(export))]
2702#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2703#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2704#[cfg_attr(feature = "serde", serde(tag = "type"))]
2705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2706#[repr(u32)]
2707#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2708pub enum MavMissionResult {
2709 #[doc = "mission accepted OK"]
2710 MAV_MISSION_ACCEPTED = 0,
2711 #[doc = "Generic error / not accepting mission commands at all right now."]
2712 MAV_MISSION_ERROR = 1,
2713 #[doc = "Coordinate frame is not supported."]
2714 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2715 #[doc = "Command is not supported."]
2716 MAV_MISSION_UNSUPPORTED = 3,
2717 #[doc = "Mission items exceed storage space."]
2718 MAV_MISSION_NO_SPACE = 4,
2719 #[doc = "One of the parameters has an invalid value."]
2720 MAV_MISSION_INVALID = 5,
2721 #[doc = "param1 has an invalid value."]
2722 MAV_MISSION_INVALID_PARAM1 = 6,
2723 #[doc = "param2 has an invalid value."]
2724 MAV_MISSION_INVALID_PARAM2 = 7,
2725 #[doc = "param3 has an invalid value."]
2726 MAV_MISSION_INVALID_PARAM3 = 8,
2727 #[doc = "param4 has an invalid value."]
2728 MAV_MISSION_INVALID_PARAM4 = 9,
2729 #[doc = "x / param5 has an invalid value."]
2730 MAV_MISSION_INVALID_PARAM5_X = 10,
2731 #[doc = "y / param6 has an invalid value."]
2732 MAV_MISSION_INVALID_PARAM6_Y = 11,
2733 #[doc = "z / param7 has an invalid value."]
2734 MAV_MISSION_INVALID_PARAM7 = 12,
2735 #[doc = "Mission item received out of sequence"]
2736 MAV_MISSION_INVALID_SEQUENCE = 13,
2737 #[doc = "Not accepting any mission commands from this communication partner."]
2738 MAV_MISSION_DENIED = 14,
2739 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2740 MAV_MISSION_OPERATION_CANCELLED = 15,
2741}
2742impl MavMissionResult {
2743 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2744}
2745impl Default for MavMissionResult {
2746 fn default() -> Self {
2747 Self::DEFAULT
2748 }
2749}
2750#[cfg_attr(feature = "ts", derive(TS))]
2751#[cfg_attr(feature = "ts", ts(export))]
2752#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2754#[cfg_attr(feature = "serde", serde(tag = "type"))]
2755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2756#[repr(u32)]
2757#[doc = "Type of mission items being requested/sent in mission protocol."]
2758pub enum MavMissionType {
2759 #[doc = "Items are mission commands for main mission."]
2760 MAV_MISSION_TYPE_MISSION = 0,
2761 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2762 MAV_MISSION_TYPE_FENCE = 1,
2763 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2764 MAV_MISSION_TYPE_RALLY = 2,
2765 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2766 MAV_MISSION_TYPE_ALL = 255,
2767}
2768impl MavMissionType {
2769 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2770}
2771impl Default for MavMissionType {
2772 fn default() -> Self {
2773 Self::DEFAULT
2774 }
2775}
2776#[cfg_attr(feature = "ts", derive(TS))]
2777#[cfg_attr(feature = "ts", ts(export))]
2778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2780#[cfg_attr(feature = "serde", serde(tag = "type"))]
2781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2782#[repr(u32)]
2783#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2784pub enum MavMode {
2785 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2786 MAV_MODE_PREFLIGHT = 0,
2787 #[doc = "System is allowed to be active, under assisted RC control."]
2788 MAV_MODE_STABILIZE_DISARMED = 80,
2789 #[doc = "System is allowed to be active, under assisted RC control."]
2790 MAV_MODE_STABILIZE_ARMED = 208,
2791 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2792 MAV_MODE_MANUAL_DISARMED = 64,
2793 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2794 MAV_MODE_MANUAL_ARMED = 192,
2795 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2796 MAV_MODE_GUIDED_DISARMED = 88,
2797 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2798 MAV_MODE_GUIDED_ARMED = 216,
2799 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2800 MAV_MODE_AUTO_DISARMED = 92,
2801 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2802 MAV_MODE_AUTO_ARMED = 220,
2803 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2804 MAV_MODE_TEST_DISARMED = 66,
2805 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2806 MAV_MODE_TEST_ARMED = 194,
2807}
2808impl MavMode {
2809 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2810}
2811impl Default for MavMode {
2812 fn default() -> Self {
2813 Self::DEFAULT
2814 }
2815}
2816bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2817impl MavModeFlag {
2818 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2819}
2820impl Default for MavModeFlag {
2821 fn default() -> Self {
2822 Self::DEFAULT
2823 }
2824}
2825#[cfg_attr(feature = "ts", derive(TS))]
2826#[cfg_attr(feature = "ts", ts(export))]
2827#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2829#[cfg_attr(feature = "serde", serde(tag = "type"))]
2830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2831#[repr(u32)]
2832#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2833pub enum MavModeFlagDecodePosition {
2834 #[doc = "First bit: 10000000"]
2835 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2836 #[doc = "Second bit: 01000000"]
2837 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2838 #[doc = "Third bit: 00100000"]
2839 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2840 #[doc = "Fourth bit: 00010000"]
2841 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2842 #[doc = "Fifth bit: 00001000"]
2843 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2844 #[doc = "Sixth bit: 00000100"]
2845 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2846 #[doc = "Seventh bit: 00000010"]
2847 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2848 #[doc = "Eighth bit: 00000001"]
2849 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2850}
2851impl MavModeFlagDecodePosition {
2852 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2853}
2854impl Default for MavModeFlagDecodePosition {
2855 fn default() -> Self {
2856 Self::DEFAULT
2857 }
2858}
2859bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2860impl MavModeProperty {
2861 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2862}
2863impl Default for MavModeProperty {
2864 fn default() -> Self {
2865 Self::DEFAULT
2866 }
2867}
2868#[cfg_attr(feature = "ts", derive(TS))]
2869#[cfg_attr(feature = "ts", ts(export))]
2870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2872#[cfg_attr(feature = "serde", serde(tag = "type"))]
2873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2874#[repr(u32)]
2875#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2876#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2877pub enum MavMountMode {
2878 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2879 MAV_MOUNT_MODE_RETRACT = 0,
2880 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2881 MAV_MOUNT_MODE_NEUTRAL = 1,
2882 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2883 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2884 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2885 MAV_MOUNT_MODE_RC_TARGETING = 3,
2886 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2887 MAV_MOUNT_MODE_GPS_POINT = 4,
2888 #[doc = "Gimbal tracks system with specified system ID"]
2889 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2890 #[doc = "Gimbal tracks home position"]
2891 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2892}
2893impl MavMountMode {
2894 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2895}
2896impl Default for MavMountMode {
2897 fn default() -> Self {
2898 Self::DEFAULT
2899 }
2900}
2901#[cfg_attr(feature = "ts", derive(TS))]
2902#[cfg_attr(feature = "ts", ts(export))]
2903#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2905#[cfg_attr(feature = "serde", serde(tag = "type"))]
2906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2907#[repr(u32)]
2908pub enum MavOdidArmStatus {
2909 #[doc = "Passing arming checks."]
2910 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2911 #[doc = "Generic arming failure, see error string for details."]
2912 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2913}
2914impl MavOdidArmStatus {
2915 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2916}
2917impl Default for MavOdidArmStatus {
2918 fn default() -> Self {
2919 Self::DEFAULT
2920 }
2921}
2922#[cfg_attr(feature = "ts", derive(TS))]
2923#[cfg_attr(feature = "ts", ts(export))]
2924#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2926#[cfg_attr(feature = "serde", serde(tag = "type"))]
2927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2928#[repr(u32)]
2929pub enum MavOdidAuthType {
2930 #[doc = "No authentication type is specified."]
2931 MAV_ODID_AUTH_TYPE_NONE = 0,
2932 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2933 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2934 #[doc = "Signature for the Operator ID."]
2935 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2936 #[doc = "Signature for the entire message set."]
2937 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2938 #[doc = "Authentication is provided by Network Remote ID."]
2939 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2940 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2941 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2942}
2943impl MavOdidAuthType {
2944 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2945}
2946impl Default for MavOdidAuthType {
2947 fn default() -> Self {
2948 Self::DEFAULT
2949 }
2950}
2951#[cfg_attr(feature = "ts", derive(TS))]
2952#[cfg_attr(feature = "ts", ts(export))]
2953#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2955#[cfg_attr(feature = "serde", serde(tag = "type"))]
2956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2957#[repr(u32)]
2958pub enum MavOdidCategoryEu {
2959 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2960 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2961 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2962 MAV_ODID_CATEGORY_EU_OPEN = 1,
2963 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2964 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2965 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2966 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2967}
2968impl MavOdidCategoryEu {
2969 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2970}
2971impl Default for MavOdidCategoryEu {
2972 fn default() -> Self {
2973 Self::DEFAULT
2974 }
2975}
2976#[cfg_attr(feature = "ts", derive(TS))]
2977#[cfg_attr(feature = "ts", ts(export))]
2978#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2980#[cfg_attr(feature = "serde", serde(tag = "type"))]
2981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2982#[repr(u32)]
2983pub enum MavOdidClassEu {
2984 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2985 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2986 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2987 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2988 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2989 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2990 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2991 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2992 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2993 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2994 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2995 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2996 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2997 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2998 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2999 MAV_ODID_CLASS_EU_CLASS_6 = 7,
3000}
3001impl MavOdidClassEu {
3002 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
3003}
3004impl Default for MavOdidClassEu {
3005 fn default() -> Self {
3006 Self::DEFAULT
3007 }
3008}
3009#[cfg_attr(feature = "ts", derive(TS))]
3010#[cfg_attr(feature = "ts", ts(export))]
3011#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3013#[cfg_attr(feature = "serde", serde(tag = "type"))]
3014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3015#[repr(u32)]
3016pub enum MavOdidClassificationType {
3017 #[doc = "The classification type for the UA is undeclared."]
3018 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
3019 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
3020 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
3021}
3022impl MavOdidClassificationType {
3023 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
3024}
3025impl Default for MavOdidClassificationType {
3026 fn default() -> Self {
3027 Self::DEFAULT
3028 }
3029}
3030#[cfg_attr(feature = "ts", derive(TS))]
3031#[cfg_attr(feature = "ts", ts(export))]
3032#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3034#[cfg_attr(feature = "serde", serde(tag = "type"))]
3035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3036#[repr(u32)]
3037pub enum MavOdidDescType {
3038 #[doc = "Optional free-form text description of the purpose of the flight."]
3039 MAV_ODID_DESC_TYPE_TEXT = 0,
3040 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
3041 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
3042 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
3043 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
3044}
3045impl MavOdidDescType {
3046 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
3047}
3048impl Default for MavOdidDescType {
3049 fn default() -> Self {
3050 Self::DEFAULT
3051 }
3052}
3053#[cfg_attr(feature = "ts", derive(TS))]
3054#[cfg_attr(feature = "ts", ts(export))]
3055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3057#[cfg_attr(feature = "serde", serde(tag = "type"))]
3058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3059#[repr(u32)]
3060pub enum MavOdidHeightRef {
3061 #[doc = "The height field is relative to the take-off location."]
3062 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
3063 #[doc = "The height field is relative to ground."]
3064 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
3065}
3066impl MavOdidHeightRef {
3067 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
3068}
3069impl Default for MavOdidHeightRef {
3070 fn default() -> Self {
3071 Self::DEFAULT
3072 }
3073}
3074#[cfg_attr(feature = "ts", derive(TS))]
3075#[cfg_attr(feature = "ts", ts(export))]
3076#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3078#[cfg_attr(feature = "serde", serde(tag = "type"))]
3079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3080#[repr(u32)]
3081pub enum MavOdidHorAcc {
3082 #[doc = "The horizontal accuracy is unknown."]
3083 MAV_ODID_HOR_ACC_UNKNOWN = 0,
3084 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
3085 MAV_ODID_HOR_ACC_10NM = 1,
3086 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
3087 MAV_ODID_HOR_ACC_4NM = 2,
3088 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
3089 MAV_ODID_HOR_ACC_2NM = 3,
3090 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
3091 MAV_ODID_HOR_ACC_1NM = 4,
3092 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
3093 MAV_ODID_HOR_ACC_0_5NM = 5,
3094 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
3095 MAV_ODID_HOR_ACC_0_3NM = 6,
3096 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
3097 MAV_ODID_HOR_ACC_0_1NM = 7,
3098 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
3099 MAV_ODID_HOR_ACC_0_05NM = 8,
3100 #[doc = "The horizontal accuracy is smaller than 30 meter."]
3101 MAV_ODID_HOR_ACC_30_METER = 9,
3102 #[doc = "The horizontal accuracy is smaller than 10 meter."]
3103 MAV_ODID_HOR_ACC_10_METER = 10,
3104 #[doc = "The horizontal accuracy is smaller than 3 meter."]
3105 MAV_ODID_HOR_ACC_3_METER = 11,
3106 #[doc = "The horizontal accuracy is smaller than 1 meter."]
3107 MAV_ODID_HOR_ACC_1_METER = 12,
3108}
3109impl MavOdidHorAcc {
3110 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
3111}
3112impl Default for MavOdidHorAcc {
3113 fn default() -> Self {
3114 Self::DEFAULT
3115 }
3116}
3117#[cfg_attr(feature = "ts", derive(TS))]
3118#[cfg_attr(feature = "ts", ts(export))]
3119#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3121#[cfg_attr(feature = "serde", serde(tag = "type"))]
3122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3123#[repr(u32)]
3124pub enum MavOdidIdType {
3125 #[doc = "No type defined."]
3126 MAV_ODID_ID_TYPE_NONE = 0,
3127 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
3128 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
3129 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
3130 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
3131 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
3132 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
3133 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
3134 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
3135}
3136impl MavOdidIdType {
3137 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
3138}
3139impl Default for MavOdidIdType {
3140 fn default() -> Self {
3141 Self::DEFAULT
3142 }
3143}
3144#[cfg_attr(feature = "ts", derive(TS))]
3145#[cfg_attr(feature = "ts", ts(export))]
3146#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3148#[cfg_attr(feature = "serde", serde(tag = "type"))]
3149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3150#[repr(u32)]
3151pub enum MavOdidOperatorIdType {
3152 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3153 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3154}
3155impl MavOdidOperatorIdType {
3156 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3157}
3158impl Default for MavOdidOperatorIdType {
3159 fn default() -> Self {
3160 Self::DEFAULT
3161 }
3162}
3163#[cfg_attr(feature = "ts", derive(TS))]
3164#[cfg_attr(feature = "ts", ts(export))]
3165#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3167#[cfg_attr(feature = "serde", serde(tag = "type"))]
3168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3169#[repr(u32)]
3170pub enum MavOdidOperatorLocationType {
3171 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3172 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3173 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3174 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3175 #[doc = "The location/altitude of the operator are fixed values."]
3176 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3177}
3178impl MavOdidOperatorLocationType {
3179 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3180}
3181impl Default for MavOdidOperatorLocationType {
3182 fn default() -> Self {
3183 Self::DEFAULT
3184 }
3185}
3186#[cfg_attr(feature = "ts", derive(TS))]
3187#[cfg_attr(feature = "ts", ts(export))]
3188#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3190#[cfg_attr(feature = "serde", serde(tag = "type"))]
3191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3192#[repr(u32)]
3193pub enum MavOdidSpeedAcc {
3194 #[doc = "The speed accuracy is unknown."]
3195 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3196 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3197 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3198 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3199 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3200 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3201 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3202 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3203 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3204}
3205impl MavOdidSpeedAcc {
3206 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3207}
3208impl Default for MavOdidSpeedAcc {
3209 fn default() -> Self {
3210 Self::DEFAULT
3211 }
3212}
3213#[cfg_attr(feature = "ts", derive(TS))]
3214#[cfg_attr(feature = "ts", ts(export))]
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220pub enum MavOdidStatus {
3221 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3222 MAV_ODID_STATUS_UNDECLARED = 0,
3223 #[doc = "The UA is on the ground."]
3224 MAV_ODID_STATUS_GROUND = 1,
3225 #[doc = "The UA is in the air."]
3226 MAV_ODID_STATUS_AIRBORNE = 2,
3227 #[doc = "The UA is having an emergency."]
3228 MAV_ODID_STATUS_EMERGENCY = 3,
3229 #[doc = "The remote ID system is failing or unreliable in some way."]
3230 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3231}
3232impl MavOdidStatus {
3233 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3234}
3235impl Default for MavOdidStatus {
3236 fn default() -> Self {
3237 Self::DEFAULT
3238 }
3239}
3240#[cfg_attr(feature = "ts", derive(TS))]
3241#[cfg_attr(feature = "ts", ts(export))]
3242#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3244#[cfg_attr(feature = "serde", serde(tag = "type"))]
3245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3246#[repr(u32)]
3247pub enum MavOdidTimeAcc {
3248 #[doc = "The timestamp accuracy is unknown."]
3249 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3250 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3251 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3252 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3253 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3254 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3255 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3256 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3257 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3258 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3259 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3260 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3261 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3262 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3263 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3264 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3265 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3266 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3267 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3268 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3269 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3270 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3271 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3272 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3273 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3274 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3275 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3276 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3277 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3278 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3279 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3280}
3281impl MavOdidTimeAcc {
3282 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3283}
3284impl Default for MavOdidTimeAcc {
3285 fn default() -> Self {
3286 Self::DEFAULT
3287 }
3288}
3289#[cfg_attr(feature = "ts", derive(TS))]
3290#[cfg_attr(feature = "ts", ts(export))]
3291#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3293#[cfg_attr(feature = "serde", serde(tag = "type"))]
3294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3295#[repr(u32)]
3296pub enum MavOdidUaType {
3297 #[doc = "No UA (Unmanned Aircraft) type defined."]
3298 MAV_ODID_UA_TYPE_NONE = 0,
3299 #[doc = "Aeroplane/Airplane. Fixed wing."]
3300 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3301 #[doc = "Helicopter or multirotor."]
3302 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3303 #[doc = "Gyroplane."]
3304 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3305 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3306 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3307 #[doc = "Ornithopter."]
3308 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3309 #[doc = "Glider."]
3310 MAV_ODID_UA_TYPE_GLIDER = 6,
3311 #[doc = "Kite."]
3312 MAV_ODID_UA_TYPE_KITE = 7,
3313 #[doc = "Free Balloon."]
3314 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3315 #[doc = "Captive Balloon."]
3316 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3317 #[doc = "Airship. E.g. a blimp."]
3318 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3319 #[doc = "Free Fall/Parachute (unpowered)."]
3320 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3321 #[doc = "Rocket."]
3322 MAV_ODID_UA_TYPE_ROCKET = 12,
3323 #[doc = "Tethered powered aircraft."]
3324 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3325 #[doc = "Ground Obstacle."]
3326 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3327 #[doc = "Other type of aircraft not listed earlier."]
3328 MAV_ODID_UA_TYPE_OTHER = 15,
3329}
3330impl MavOdidUaType {
3331 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3332}
3333impl Default for MavOdidUaType {
3334 fn default() -> Self {
3335 Self::DEFAULT
3336 }
3337}
3338#[cfg_attr(feature = "ts", derive(TS))]
3339#[cfg_attr(feature = "ts", ts(export))]
3340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3342#[cfg_attr(feature = "serde", serde(tag = "type"))]
3343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3344#[repr(u32)]
3345pub enum MavOdidVerAcc {
3346 #[doc = "The vertical accuracy is unknown."]
3347 MAV_ODID_VER_ACC_UNKNOWN = 0,
3348 #[doc = "The vertical accuracy is smaller than 150 meter."]
3349 MAV_ODID_VER_ACC_150_METER = 1,
3350 #[doc = "The vertical accuracy is smaller than 45 meter."]
3351 MAV_ODID_VER_ACC_45_METER = 2,
3352 #[doc = "The vertical accuracy is smaller than 25 meter."]
3353 MAV_ODID_VER_ACC_25_METER = 3,
3354 #[doc = "The vertical accuracy is smaller than 10 meter."]
3355 MAV_ODID_VER_ACC_10_METER = 4,
3356 #[doc = "The vertical accuracy is smaller than 3 meter."]
3357 MAV_ODID_VER_ACC_3_METER = 5,
3358 #[doc = "The vertical accuracy is smaller than 1 meter."]
3359 MAV_ODID_VER_ACC_1_METER = 6,
3360}
3361impl MavOdidVerAcc {
3362 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3363}
3364impl Default for MavOdidVerAcc {
3365 fn default() -> Self {
3366 Self::DEFAULT
3367 }
3368}
3369#[cfg_attr(feature = "ts", derive(TS))]
3370#[cfg_attr(feature = "ts", ts(export))]
3371#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3373#[cfg_attr(feature = "serde", serde(tag = "type"))]
3374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3375#[repr(u32)]
3376#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3377pub enum MavParamExtType {
3378 #[doc = "8-bit unsigned integer"]
3379 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3380 #[doc = "8-bit signed integer"]
3381 MAV_PARAM_EXT_TYPE_INT8 = 2,
3382 #[doc = "16-bit unsigned integer"]
3383 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3384 #[doc = "16-bit signed integer"]
3385 MAV_PARAM_EXT_TYPE_INT16 = 4,
3386 #[doc = "32-bit unsigned integer"]
3387 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3388 #[doc = "32-bit signed integer"]
3389 MAV_PARAM_EXT_TYPE_INT32 = 6,
3390 #[doc = "64-bit unsigned integer"]
3391 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3392 #[doc = "64-bit signed integer"]
3393 MAV_PARAM_EXT_TYPE_INT64 = 8,
3394 #[doc = "32-bit floating-point"]
3395 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3396 #[doc = "64-bit floating-point"]
3397 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3398 #[doc = "Custom Type"]
3399 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3400}
3401impl MavParamExtType {
3402 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3403}
3404impl Default for MavParamExtType {
3405 fn default() -> Self {
3406 Self::DEFAULT
3407 }
3408}
3409#[cfg_attr(feature = "ts", derive(TS))]
3410#[cfg_attr(feature = "ts", ts(export))]
3411#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3413#[cfg_attr(feature = "serde", serde(tag = "type"))]
3414#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3415#[repr(u32)]
3416#[doc = "Specifies the datatype of a MAVLink parameter."]
3417pub enum MavParamType {
3418 #[doc = "8-bit unsigned integer"]
3419 MAV_PARAM_TYPE_UINT8 = 1,
3420 #[doc = "8-bit signed integer"]
3421 MAV_PARAM_TYPE_INT8 = 2,
3422 #[doc = "16-bit unsigned integer"]
3423 MAV_PARAM_TYPE_UINT16 = 3,
3424 #[doc = "16-bit signed integer"]
3425 MAV_PARAM_TYPE_INT16 = 4,
3426 #[doc = "32-bit unsigned integer"]
3427 MAV_PARAM_TYPE_UINT32 = 5,
3428 #[doc = "32-bit signed integer"]
3429 MAV_PARAM_TYPE_INT32 = 6,
3430 #[doc = "64-bit unsigned integer"]
3431 MAV_PARAM_TYPE_UINT64 = 7,
3432 #[doc = "64-bit signed integer"]
3433 MAV_PARAM_TYPE_INT64 = 8,
3434 #[doc = "32-bit floating-point"]
3435 MAV_PARAM_TYPE_REAL32 = 9,
3436 #[doc = "64-bit floating-point"]
3437 MAV_PARAM_TYPE_REAL64 = 10,
3438}
3439impl MavParamType {
3440 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3441}
3442impl Default for MavParamType {
3443 fn default() -> Self {
3444 Self::DEFAULT
3445 }
3446}
3447bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3448impl MavPowerStatus {
3449 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3450}
3451impl Default for MavPowerStatus {
3452 fn default() -> Self {
3453 Self::DEFAULT
3454 }
3455}
3456bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3457impl MavProtocolCapability {
3458 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3459}
3460impl Default for MavProtocolCapability {
3461 fn default() -> Self {
3462 Self::DEFAULT
3463 }
3464}
3465#[cfg_attr(feature = "ts", derive(TS))]
3466#[cfg_attr(feature = "ts", ts(export))]
3467#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3468#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3469#[cfg_attr(feature = "serde", serde(tag = "type"))]
3470#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3471#[repr(u32)]
3472#[doc = "Result from a MAVLink command (MAV_CMD)"]
3473pub enum MavResult {
3474 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3475 MAV_RESULT_ACCEPTED = 0,
3476 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3477 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3478 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3479 MAV_RESULT_DENIED = 2,
3480 #[doc = "Command is not supported (unknown)."]
3481 MAV_RESULT_UNSUPPORTED = 3,
3482 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3483 MAV_RESULT_FAILED = 4,
3484 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3485 MAV_RESULT_IN_PROGRESS = 5,
3486 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3487 MAV_RESULT_CANCELLED = 6,
3488 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3489 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3490 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3491 MAV_RESULT_COMMAND_INT_ONLY = 8,
3492 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3493 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3494}
3495impl MavResult {
3496 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3497}
3498impl Default for MavResult {
3499 fn default() -> Self {
3500 Self::DEFAULT
3501 }
3502}
3503#[cfg_attr(feature = "ts", derive(TS))]
3504#[cfg_attr(feature = "ts", ts(export))]
3505#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3507#[cfg_attr(feature = "serde", serde(tag = "type"))]
3508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3509#[repr(u32)]
3510#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3511#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3512pub enum MavRoi {
3513 #[doc = "No region of interest."]
3514 MAV_ROI_NONE = 0,
3515 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3516 MAV_ROI_WPNEXT = 1,
3517 #[doc = "Point toward given waypoint."]
3518 MAV_ROI_WPINDEX = 2,
3519 #[doc = "Point toward fixed location."]
3520 MAV_ROI_LOCATION = 3,
3521 #[doc = "Point toward of given id."]
3522 MAV_ROI_TARGET = 4,
3523}
3524impl MavRoi {
3525 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3526}
3527impl Default for MavRoi {
3528 fn default() -> Self {
3529 Self::DEFAULT
3530 }
3531}
3532#[cfg_attr(feature = "ts", derive(TS))]
3533#[cfg_attr(feature = "ts", ts(export))]
3534#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3536#[cfg_attr(feature = "serde", serde(tag = "type"))]
3537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3538#[repr(u32)]
3539#[doc = "Enumeration of sensor orientation, according to its rotations"]
3540pub enum MavSensorOrientation {
3541 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3542 MAV_SENSOR_ROTATION_NONE = 0,
3543 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3544 MAV_SENSOR_ROTATION_YAW_45 = 1,
3545 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3546 MAV_SENSOR_ROTATION_YAW_90 = 2,
3547 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3548 MAV_SENSOR_ROTATION_YAW_135 = 3,
3549 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3550 MAV_SENSOR_ROTATION_YAW_180 = 4,
3551 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3552 MAV_SENSOR_ROTATION_YAW_225 = 5,
3553 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3554 MAV_SENSOR_ROTATION_YAW_270 = 6,
3555 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3556 MAV_SENSOR_ROTATION_YAW_315 = 7,
3557 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3558 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3559 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3560 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3561 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3562 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3563 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3564 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3565 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3566 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3567 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3568 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3569 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3570 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3571 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3572 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3573 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3574 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3575 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3576 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3577 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3578 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3579 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3580 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3581 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3582 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3583 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3584 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3585 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3586 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3587 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3588 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3589 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3590 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3591 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3592 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3593 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3594 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3595 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3596 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3597 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3598 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3599 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3600 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3601 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3602 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3603 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3604 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3605 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3606 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3607 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3608 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3609 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3610 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3611 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3612 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3613 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3614 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3615 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3616 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3617 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3618 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3619 #[doc = "Pitch: 315"]
3620 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3621 #[doc = "Roll: 90, Pitch: 315"]
3622 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3623 #[doc = "Custom orientation"]
3624 MAV_SENSOR_ROTATION_CUSTOM = 100,
3625}
3626impl MavSensorOrientation {
3627 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3628}
3629impl Default for MavSensorOrientation {
3630 fn default() -> Self {
3631 Self::DEFAULT
3632 }
3633}
3634#[cfg_attr(feature = "ts", derive(TS))]
3635#[cfg_attr(feature = "ts", ts(export))]
3636#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3638#[cfg_attr(feature = "serde", serde(tag = "type"))]
3639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3640#[repr(u32)]
3641#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3642pub enum MavSeverity {
3643 #[doc = "System is unusable. This is a \"panic\" condition."]
3644 MAV_SEVERITY_EMERGENCY = 0,
3645 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3646 MAV_SEVERITY_ALERT = 1,
3647 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3648 MAV_SEVERITY_CRITICAL = 2,
3649 #[doc = "Indicates an error in secondary/redundant systems."]
3650 MAV_SEVERITY_ERROR = 3,
3651 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3652 MAV_SEVERITY_WARNING = 4,
3653 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3654 MAV_SEVERITY_NOTICE = 5,
3655 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3656 MAV_SEVERITY_INFO = 6,
3657 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3658 MAV_SEVERITY_DEBUG = 7,
3659}
3660impl MavSeverity {
3661 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3662}
3663impl Default for MavSeverity {
3664 fn default() -> Self {
3665 Self::DEFAULT
3666 }
3667}
3668#[cfg_attr(feature = "ts", derive(TS))]
3669#[cfg_attr(feature = "ts", ts(export))]
3670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3672#[cfg_attr(feature = "serde", serde(tag = "type"))]
3673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3674#[repr(u32)]
3675#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3676pub enum MavStandardMode {
3677 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3678 MAV_STANDARD_MODE_NON_STANDARD = 0,
3679 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3680 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3681 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3682 MAV_STANDARD_MODE_ORBIT = 2,
3683 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3684 MAV_STANDARD_MODE_CRUISE = 3,
3685 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3686 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3687 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3688 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3689 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3690 MAV_STANDARD_MODE_MISSION = 6,
3691 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3692 MAV_STANDARD_MODE_LAND = 7,
3693 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3694 MAV_STANDARD_MODE_TAKEOFF = 8,
3695}
3696impl MavStandardMode {
3697 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3698}
3699impl Default for MavStandardMode {
3700 fn default() -> Self {
3701 Self::DEFAULT
3702 }
3703}
3704#[cfg_attr(feature = "ts", derive(TS))]
3705#[cfg_attr(feature = "ts", ts(export))]
3706#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3708#[cfg_attr(feature = "serde", serde(tag = "type"))]
3709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3710#[repr(u32)]
3711pub enum MavState {
3712 #[doc = "Uninitialized system, state is unknown."]
3713 MAV_STATE_UNINIT = 0,
3714 #[doc = "System is booting up."]
3715 MAV_STATE_BOOT = 1,
3716 #[doc = "System is calibrating and not flight-ready."]
3717 MAV_STATE_CALIBRATING = 2,
3718 #[doc = "System is grounded and on standby. It can be launched any time."]
3719 MAV_STATE_STANDBY = 3,
3720 #[doc = "System is active and might be already airborne. Motors are engaged."]
3721 MAV_STATE_ACTIVE = 4,
3722 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3723 MAV_STATE_CRITICAL = 5,
3724 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3725 MAV_STATE_EMERGENCY = 6,
3726 #[doc = "System just initialized its power-down sequence, will shut down now."]
3727 MAV_STATE_POWEROFF = 7,
3728 #[doc = "System is terminating itself (failsafe or commanded)."]
3729 MAV_STATE_FLIGHT_TERMINATION = 8,
3730}
3731impl MavState {
3732 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3733}
3734impl Default for MavState {
3735 fn default() -> Self {
3736 Self::DEFAULT
3737 }
3738}
3739bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3740impl MavSysStatusSensor {
3741 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3742}
3743impl Default for MavSysStatusSensor {
3744 fn default() -> Self {
3745 Self::DEFAULT
3746 }
3747}
3748bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3749impl MavSysStatusSensorExtended {
3750 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3751}
3752impl Default for MavSysStatusSensorExtended {
3753 fn default() -> Self {
3754 Self::DEFAULT
3755 }
3756}
3757#[cfg_attr(feature = "ts", derive(TS))]
3758#[cfg_attr(feature = "ts", ts(export))]
3759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3761#[cfg_attr(feature = "serde", serde(tag = "type"))]
3762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3763#[repr(u32)]
3764pub enum MavTunnelPayloadType {
3765 #[doc = "Encoding of payload unknown."]
3766 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3767 #[doc = "Registered for STorM32 gimbal controller."]
3768 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3769 #[doc = "Registered for STorM32 gimbal controller."]
3770 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3771 #[doc = "Registered for STorM32 gimbal controller."]
3772 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3773 #[doc = "Registered for STorM32 gimbal controller."]
3774 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3775 #[doc = "Registered for STorM32 gimbal controller."]
3776 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3777 #[doc = "Registered for STorM32 gimbal controller."]
3778 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3779 #[doc = "Registered for STorM32 gimbal controller."]
3780 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3781 #[doc = "Registered for STorM32 gimbal controller."]
3782 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3783 #[doc = "Registered for STorM32 gimbal controller."]
3784 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3785 #[doc = "Registered for STorM32 gimbal controller."]
3786 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3787 #[doc = "Registered for ModalAI remote OSD protocol."]
3788 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3789 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3790 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3791 #[doc = "Registered for ModalAI vendor use."]
3792 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3793}
3794impl MavTunnelPayloadType {
3795 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3796}
3797impl Default for MavTunnelPayloadType {
3798 fn default() -> Self {
3799 Self::DEFAULT
3800 }
3801}
3802#[cfg_attr(feature = "ts", derive(TS))]
3803#[cfg_attr(feature = "ts", ts(export))]
3804#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3806#[cfg_attr(feature = "serde", serde(tag = "type"))]
3807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3808#[repr(u32)]
3809#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3810pub enum MavType {
3811 #[doc = "Generic micro air vehicle"]
3812 MAV_TYPE_GENERIC = 0,
3813 #[doc = "Fixed wing aircraft."]
3814 MAV_TYPE_FIXED_WING = 1,
3815 #[doc = "Quadrotor"]
3816 MAV_TYPE_QUADROTOR = 2,
3817 #[doc = "Coaxial helicopter"]
3818 MAV_TYPE_COAXIAL = 3,
3819 #[doc = "Normal helicopter with tail rotor."]
3820 MAV_TYPE_HELICOPTER = 4,
3821 #[doc = "Ground installation"]
3822 MAV_TYPE_ANTENNA_TRACKER = 5,
3823 #[doc = "Operator control unit / ground control station"]
3824 MAV_TYPE_GCS = 6,
3825 #[doc = "Airship, controlled"]
3826 MAV_TYPE_AIRSHIP = 7,
3827 #[doc = "Free balloon, uncontrolled"]
3828 MAV_TYPE_FREE_BALLOON = 8,
3829 #[doc = "Rocket"]
3830 MAV_TYPE_ROCKET = 9,
3831 #[doc = "Ground rover"]
3832 MAV_TYPE_GROUND_ROVER = 10,
3833 #[doc = "Surface vessel, boat, ship"]
3834 MAV_TYPE_SURFACE_BOAT = 11,
3835 #[doc = "Submarine"]
3836 MAV_TYPE_SUBMARINE = 12,
3837 #[doc = "Hexarotor"]
3838 MAV_TYPE_HEXAROTOR = 13,
3839 #[doc = "Octorotor"]
3840 MAV_TYPE_OCTOROTOR = 14,
3841 #[doc = "Tricopter"]
3842 MAV_TYPE_TRICOPTER = 15,
3843 #[doc = "Flapping wing"]
3844 MAV_TYPE_FLAPPING_WING = 16,
3845 #[doc = "Kite"]
3846 MAV_TYPE_KITE = 17,
3847 #[doc = "Onboard companion controller"]
3848 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3849 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3850 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3851 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3852 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3853 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3854 MAV_TYPE_VTOL_TILTROTOR = 21,
3855 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3856 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3857 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3858 MAV_TYPE_VTOL_TAILSITTER = 23,
3859 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3860 MAV_TYPE_VTOL_TILTWING = 24,
3861 #[doc = "VTOL reserved 5"]
3862 MAV_TYPE_VTOL_RESERVED5 = 25,
3863 #[doc = "Gimbal"]
3864 MAV_TYPE_GIMBAL = 26,
3865 #[doc = "ADSB system"]
3866 MAV_TYPE_ADSB = 27,
3867 #[doc = "Steerable, nonrigid airfoil"]
3868 MAV_TYPE_PARAFOIL = 28,
3869 #[doc = "Dodecarotor"]
3870 MAV_TYPE_DODECAROTOR = 29,
3871 #[doc = "Camera"]
3872 MAV_TYPE_CAMERA = 30,
3873 #[doc = "Charging station"]
3874 MAV_TYPE_CHARGING_STATION = 31,
3875 #[doc = "FLARM collision avoidance system"]
3876 MAV_TYPE_FLARM = 32,
3877 #[doc = "Servo"]
3878 MAV_TYPE_SERVO = 33,
3879 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3880 MAV_TYPE_ODID = 34,
3881 #[doc = "Decarotor"]
3882 MAV_TYPE_DECAROTOR = 35,
3883 #[doc = "Battery"]
3884 MAV_TYPE_BATTERY = 36,
3885 #[doc = "Parachute"]
3886 MAV_TYPE_PARACHUTE = 37,
3887 #[doc = "Log"]
3888 MAV_TYPE_LOG = 38,
3889 #[doc = "OSD"]
3890 MAV_TYPE_OSD = 39,
3891 #[doc = "IMU"]
3892 MAV_TYPE_IMU = 40,
3893 #[doc = "GPS"]
3894 MAV_TYPE_GPS = 41,
3895 #[doc = "Winch"]
3896 MAV_TYPE_WINCH = 42,
3897 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3898 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3899 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3900 MAV_TYPE_ILLUMINATOR = 44,
3901 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3902 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3903}
3904impl MavType {
3905 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3906}
3907impl Default for MavType {
3908 fn default() -> Self {
3909 Self::DEFAULT
3910 }
3911}
3912#[cfg_attr(feature = "ts", derive(TS))]
3913#[cfg_attr(feature = "ts", ts(export))]
3914#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3916#[cfg_attr(feature = "serde", serde(tag = "type"))]
3917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3918#[repr(u32)]
3919#[doc = "Enumeration of VTOL states"]
3920pub enum MavVtolState {
3921 #[doc = "MAV is not configured as VTOL"]
3922 MAV_VTOL_STATE_UNDEFINED = 0,
3923 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3924 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3925 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3926 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3927 #[doc = "VTOL is in multicopter state"]
3928 MAV_VTOL_STATE_MC = 3,
3929 #[doc = "VTOL is in fixed-wing state"]
3930 MAV_VTOL_STATE_FW = 4,
3931}
3932impl MavVtolState {
3933 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3934}
3935impl Default for MavVtolState {
3936 fn default() -> Self {
3937 Self::DEFAULT
3938 }
3939}
3940bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3941impl MavWinchStatusFlag {
3942 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3943}
3944impl Default for MavWinchStatusFlag {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[cfg_attr(feature = "ts", derive(TS))]
3950#[cfg_attr(feature = "ts", ts(export))]
3951#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3953#[cfg_attr(feature = "serde", serde(tag = "type"))]
3954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3955#[repr(u32)]
3956pub enum MavlinkDataStreamType {
3957 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3958 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3959 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3960 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3961 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3962 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3963}
3964impl MavlinkDataStreamType {
3965 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3966}
3967impl Default for MavlinkDataStreamType {
3968 fn default() -> Self {
3969 Self::DEFAULT
3970 }
3971}
3972#[cfg_attr(feature = "ts", derive(TS))]
3973#[cfg_attr(feature = "ts", ts(export))]
3974#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3976#[cfg_attr(feature = "serde", serde(tag = "type"))]
3977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3978#[repr(u32)]
3979#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3980pub enum MissionState {
3981 #[doc = "The mission status reporting is not supported."]
3982 MISSION_STATE_UNKNOWN = 0,
3983 #[doc = "No mission on the vehicle."]
3984 MISSION_STATE_NO_MISSION = 1,
3985 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3986 MISSION_STATE_NOT_STARTED = 2,
3987 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3988 MISSION_STATE_ACTIVE = 3,
3989 #[doc = "Mission is paused when in auto mode."]
3990 MISSION_STATE_PAUSED = 4,
3991 #[doc = "Mission has executed all mission items."]
3992 MISSION_STATE_COMPLETE = 5,
3993}
3994impl MissionState {
3995 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3996}
3997impl Default for MissionState {
3998 fn default() -> Self {
3999 Self::DEFAULT
4000 }
4001}
4002#[cfg_attr(feature = "ts", derive(TS))]
4003#[cfg_attr(feature = "ts", ts(export))]
4004#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4006#[cfg_attr(feature = "serde", serde(tag = "type"))]
4007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4008#[repr(u32)]
4009#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
4010pub enum MotorTestOrder {
4011 #[doc = "Default autopilot motor test method."]
4012 MOTOR_TEST_ORDER_DEFAULT = 0,
4013 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
4014 MOTOR_TEST_ORDER_SEQUENCE = 1,
4015 #[doc = "Motor numbers are specified as the output as labeled on the board."]
4016 MOTOR_TEST_ORDER_BOARD = 2,
4017}
4018impl MotorTestOrder {
4019 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
4020}
4021impl Default for MotorTestOrder {
4022 fn default() -> Self {
4023 Self::DEFAULT
4024 }
4025}
4026#[cfg_attr(feature = "ts", derive(TS))]
4027#[cfg_attr(feature = "ts", ts(export))]
4028#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4030#[cfg_attr(feature = "serde", serde(tag = "type"))]
4031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4032#[repr(u32)]
4033#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
4034pub enum MotorTestThrottleType {
4035 #[doc = "Throttle as a percentage (0 ~ 100)"]
4036 MOTOR_TEST_THROTTLE_PERCENT = 0,
4037 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
4038 MOTOR_TEST_THROTTLE_PWM = 1,
4039 #[doc = "Throttle pass-through from pilot's transmitter."]
4040 MOTOR_TEST_THROTTLE_PILOT = 2,
4041 #[doc = "Per-motor compass calibration test."]
4042 MOTOR_TEST_COMPASS_CAL = 3,
4043}
4044impl MotorTestThrottleType {
4045 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
4046}
4047impl Default for MotorTestThrottleType {
4048 fn default() -> Self {
4049 Self::DEFAULT
4050 }
4051}
4052#[cfg_attr(feature = "ts", derive(TS))]
4053#[cfg_attr(feature = "ts", ts(export))]
4054#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4056#[cfg_attr(feature = "serde", serde(tag = "type"))]
4057#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4058#[repr(u32)]
4059pub enum NavVtolLandOptions {
4060 #[doc = "Default autopilot landing behaviour."]
4061 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
4062 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
4063 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
4064 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
4065 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
4066}
4067impl NavVtolLandOptions {
4068 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
4069}
4070impl Default for NavVtolLandOptions {
4071 fn default() -> Self {
4072 Self::DEFAULT
4073 }
4074}
4075#[cfg_attr(feature = "ts", derive(TS))]
4076#[cfg_attr(feature = "ts", ts(export))]
4077#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4079#[cfg_attr(feature = "serde", serde(tag = "type"))]
4080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4081#[repr(u32)]
4082#[doc = "Yaw behaviour during orbit flight."]
4083pub enum OrbitYawBehaviour {
4084 #[doc = "Vehicle front points to the center (default)."]
4085 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
4086 #[doc = "Vehicle front holds heading when message received."]
4087 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
4088 #[doc = "Yaw uncontrolled."]
4089 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
4090 #[doc = "Vehicle front follows flight path (tangential to circle)."]
4091 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
4092 #[doc = "Yaw controlled by RC input."]
4093 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
4094 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
4095 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
4096}
4097impl OrbitYawBehaviour {
4098 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
4099}
4100impl Default for OrbitYawBehaviour {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
4113pub enum ParachuteAction {
4114 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
4115 PARACHUTE_DISABLE = 0,
4116 #[doc = "Enable auto-release of parachute."]
4117 PARACHUTE_ENABLE = 1,
4118 #[doc = "Release parachute and kill motors."]
4119 PARACHUTE_RELEASE = 2,
4120}
4121impl ParachuteAction {
4122 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
4123}
4124impl Default for ParachuteAction {
4125 fn default() -> Self {
4126 Self::DEFAULT
4127 }
4128}
4129#[cfg_attr(feature = "ts", derive(TS))]
4130#[cfg_attr(feature = "ts", ts(export))]
4131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4133#[cfg_attr(feature = "serde", serde(tag = "type"))]
4134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4135#[repr(u32)]
4136#[doc = "Result from PARAM_EXT_SET message."]
4137pub enum ParamAck {
4138 #[doc = "Parameter value ACCEPTED and SET"]
4139 PARAM_ACK_ACCEPTED = 0,
4140 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4141 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4142 #[doc = "Parameter failed to set"]
4143 PARAM_ACK_FAILED = 2,
4144 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4145 PARAM_ACK_IN_PROGRESS = 3,
4146}
4147impl ParamAck {
4148 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4149}
4150impl Default for ParamAck {
4151 fn default() -> Self {
4152 Self::DEFAULT
4153 }
4154}
4155bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4156impl PositionTargetTypemask {
4157 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4158}
4159impl Default for PositionTargetTypemask {
4160 fn default() -> Self {
4161 Self::DEFAULT
4162 }
4163}
4164#[cfg_attr(feature = "ts", derive(TS))]
4165#[cfg_attr(feature = "ts", ts(export))]
4166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4168#[cfg_attr(feature = "serde", serde(tag = "type"))]
4169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4170#[repr(u32)]
4171#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4172pub enum PrecisionLandMode {
4173 #[doc = "Normal (non-precision) landing."]
4174 PRECISION_LAND_MODE_DISABLED = 0,
4175 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4176 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4177 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4178 PRECISION_LAND_MODE_REQUIRED = 2,
4179}
4180impl PrecisionLandMode {
4181 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4182}
4183impl Default for PrecisionLandMode {
4184 fn default() -> Self {
4185 Self::DEFAULT
4186 }
4187}
4188#[cfg_attr(feature = "ts", derive(TS))]
4189#[cfg_attr(feature = "ts", ts(export))]
4190#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4192#[cfg_attr(feature = "serde", serde(tag = "type"))]
4193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4194#[repr(u32)]
4195#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4196pub enum PreflightStorageMissionAction {
4197 #[doc = "Read current mission data from persistent storage"]
4198 MISSION_READ_PERSISTENT = 0,
4199 #[doc = "Write current mission data to persistent storage"]
4200 MISSION_WRITE_PERSISTENT = 1,
4201 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4202 MISSION_RESET_DEFAULT = 2,
4203}
4204impl PreflightStorageMissionAction {
4205 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4206}
4207impl Default for PreflightStorageMissionAction {
4208 fn default() -> Self {
4209 Self::DEFAULT
4210 }
4211}
4212#[cfg_attr(feature = "ts", derive(TS))]
4213#[cfg_attr(feature = "ts", ts(export))]
4214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4216#[cfg_attr(feature = "serde", serde(tag = "type"))]
4217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4218#[repr(u32)]
4219#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4220pub enum PreflightStorageParameterAction {
4221 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4222 PARAM_READ_PERSISTENT = 0,
4223 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4224 PARAM_WRITE_PERSISTENT = 1,
4225 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4226 PARAM_RESET_CONFIG_DEFAULT = 2,
4227 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4228 PARAM_RESET_SENSOR_DEFAULT = 3,
4229 #[doc = "Reset all parameters, including operation counters, to default values"]
4230 PARAM_RESET_ALL_DEFAULT = 4,
4231}
4232impl PreflightStorageParameterAction {
4233 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4234}
4235impl Default for PreflightStorageParameterAction {
4236 fn default() -> Self {
4237 Self::DEFAULT
4238 }
4239}
4240bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "RADIO_RC_CHANNELS flags (bitmask)."] pub struct RadioRcChannelsFlags : u16 { # [doc = "Failsafe is active. The content of the RC channels data in the RADIO_RC_CHANNELS message is implementation dependent."] const RADIO_RC_CHANNELS_FLAGS_FAILSAFE = 1 ; # [doc = "Channel data may be out of date. This is set when the receiver is unable to validate incoming data from the transmitter and has therefore resent the last valid data it received."] const RADIO_RC_CHANNELS_FLAGS_OUTDATED = 2 ; } }
4241impl RadioRcChannelsFlags {
4242 pub const DEFAULT: Self = Self::RADIO_RC_CHANNELS_FLAGS_FAILSAFE;
4243}
4244impl Default for RadioRcChannelsFlags {
4245 fn default() -> Self {
4246 Self::DEFAULT
4247 }
4248}
4249#[cfg_attr(feature = "ts", derive(TS))]
4250#[cfg_attr(feature = "ts", ts(export))]
4251#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4253#[cfg_attr(feature = "serde", serde(tag = "type"))]
4254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4255#[repr(u32)]
4256#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4257pub enum RcSubType {
4258 #[doc = "Spektrum DSM2"]
4259 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4260 #[doc = "Spektrum DSMX"]
4261 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4262 #[doc = "Spektrum DSMX8"]
4263 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4264}
4265impl RcSubType {
4266 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4267}
4268impl Default for RcSubType {
4269 fn default() -> Self {
4270 Self::DEFAULT
4271 }
4272}
4273#[cfg_attr(feature = "ts", derive(TS))]
4274#[cfg_attr(feature = "ts", ts(export))]
4275#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4277#[cfg_attr(feature = "serde", serde(tag = "type"))]
4278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4279#[repr(u32)]
4280#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4281pub enum RcType {
4282 #[doc = "Spektrum"]
4283 RC_TYPE_SPEKTRUM = 0,
4284 #[doc = "CRSF"]
4285 RC_TYPE_CRSF = 1,
4286}
4287impl RcType {
4288 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4289}
4290impl Default for RcType {
4291 fn default() -> Self {
4292 Self::DEFAULT
4293 }
4294}
4295#[cfg_attr(feature = "ts", derive(TS))]
4296#[cfg_attr(feature = "ts", ts(export))]
4297#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4299#[cfg_attr(feature = "serde", serde(tag = "type"))]
4300#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4301#[repr(u32)]
4302#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4303pub enum RebootShutdownConditions {
4304 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4305 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4306 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4307 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4308}
4309impl RebootShutdownConditions {
4310 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4311}
4312impl Default for RebootShutdownConditions {
4313 fn default() -> Self {
4314 Self::DEFAULT
4315 }
4316}
4317#[cfg_attr(feature = "ts", derive(TS))]
4318#[cfg_attr(feature = "ts", ts(export))]
4319#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4321#[cfg_attr(feature = "serde", serde(tag = "type"))]
4322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4323#[repr(u32)]
4324#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4325pub enum RtkBaselineCoordinateSystem {
4326 #[doc = "Earth-centered, Earth-fixed"]
4327 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4328 #[doc = "RTK basestation centered, north, east, down"]
4329 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4330}
4331impl RtkBaselineCoordinateSystem {
4332 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4333}
4334impl Default for RtkBaselineCoordinateSystem {
4335 fn default() -> Self {
4336 Self::DEFAULT
4337 }
4338}
4339#[cfg_attr(feature = "ts", derive(TS))]
4340#[cfg_attr(feature = "ts", ts(export))]
4341#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4343#[cfg_attr(feature = "serde", serde(tag = "type"))]
4344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4345#[repr(u32)]
4346#[doc = "Possible safety switch states."]
4347pub enum SafetySwitchState {
4348 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4349 SAFETY_SWITCH_STATE_SAFE = 0,
4350 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4351 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4352}
4353impl SafetySwitchState {
4354 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4355}
4356impl Default for SafetySwitchState {
4357 fn default() -> Self {
4358 Self::DEFAULT
4359 }
4360}
4361#[cfg_attr(feature = "ts", derive(TS))]
4362#[cfg_attr(feature = "ts", ts(export))]
4363#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4365#[cfg_attr(feature = "serde", serde(tag = "type"))]
4366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4367#[repr(u32)]
4368#[doc = "SERIAL_CONTROL device types"]
4369pub enum SerialControlDev {
4370 #[doc = "First telemetry port"]
4371 SERIAL_CONTROL_DEV_TELEM1 = 0,
4372 #[doc = "Second telemetry port"]
4373 SERIAL_CONTROL_DEV_TELEM2 = 1,
4374 #[doc = "First GPS port"]
4375 SERIAL_CONTROL_DEV_GPS1 = 2,
4376 #[doc = "Second GPS port"]
4377 SERIAL_CONTROL_DEV_GPS2 = 3,
4378 #[doc = "system shell"]
4379 SERIAL_CONTROL_DEV_SHELL = 10,
4380 #[doc = "SERIAL0"]
4381 SERIAL_CONTROL_SERIAL0 = 100,
4382 #[doc = "SERIAL1"]
4383 SERIAL_CONTROL_SERIAL1 = 101,
4384 #[doc = "SERIAL2"]
4385 SERIAL_CONTROL_SERIAL2 = 102,
4386 #[doc = "SERIAL3"]
4387 SERIAL_CONTROL_SERIAL3 = 103,
4388 #[doc = "SERIAL4"]
4389 SERIAL_CONTROL_SERIAL4 = 104,
4390 #[doc = "SERIAL5"]
4391 SERIAL_CONTROL_SERIAL5 = 105,
4392 #[doc = "SERIAL6"]
4393 SERIAL_CONTROL_SERIAL6 = 106,
4394 #[doc = "SERIAL7"]
4395 SERIAL_CONTROL_SERIAL7 = 107,
4396 #[doc = "SERIAL8"]
4397 SERIAL_CONTROL_SERIAL8 = 108,
4398 #[doc = "SERIAL9"]
4399 SERIAL_CONTROL_SERIAL9 = 109,
4400}
4401impl SerialControlDev {
4402 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4403}
4404impl Default for SerialControlDev {
4405 fn default() -> Self {
4406 Self::DEFAULT
4407 }
4408}
4409bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4410impl SerialControlFlag {
4411 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4412}
4413impl Default for SerialControlFlag {
4414 fn default() -> Self {
4415 Self::DEFAULT
4416 }
4417}
4418#[cfg_attr(feature = "ts", derive(TS))]
4419#[cfg_attr(feature = "ts", ts(export))]
4420#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4422#[cfg_attr(feature = "serde", serde(tag = "type"))]
4423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4424#[repr(u32)]
4425#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4426pub enum SetFocusType {
4427 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4428 FOCUS_TYPE_STEP = 0,
4429 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4430 FOCUS_TYPE_CONTINUOUS = 1,
4431 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4432 FOCUS_TYPE_RANGE = 2,
4433 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4434 FOCUS_TYPE_METERS = 3,
4435 #[doc = "Focus automatically."]
4436 FOCUS_TYPE_AUTO = 4,
4437 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4438 FOCUS_TYPE_AUTO_SINGLE = 5,
4439 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4440 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4441}
4442impl SetFocusType {
4443 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4444}
4445impl Default for SetFocusType {
4446 fn default() -> Self {
4447 Self::DEFAULT
4448 }
4449}
4450#[cfg_attr(feature = "ts", derive(TS))]
4451#[cfg_attr(feature = "ts", ts(export))]
4452#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4454#[cfg_attr(feature = "serde", serde(tag = "type"))]
4455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4456#[repr(u32)]
4457#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4458pub enum SpeedType {
4459 #[doc = "Airspeed"]
4460 SPEED_TYPE_AIRSPEED = 0,
4461 #[doc = "Groundspeed"]
4462 SPEED_TYPE_GROUNDSPEED = 1,
4463 #[doc = "Climb speed"]
4464 SPEED_TYPE_CLIMB_SPEED = 2,
4465 #[doc = "Descent speed"]
4466 SPEED_TYPE_DESCENT_SPEED = 3,
4467}
4468impl SpeedType {
4469 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4470}
4471impl Default for SpeedType {
4472 fn default() -> Self {
4473 Self::DEFAULT
4474 }
4475}
4476#[cfg_attr(feature = "ts", derive(TS))]
4477#[cfg_attr(feature = "ts", ts(export))]
4478#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4480#[cfg_attr(feature = "serde", serde(tag = "type"))]
4481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4482#[repr(u32)]
4483#[doc = "Flags to indicate the status of camera storage."]
4484pub enum StorageStatus {
4485 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4486 STORAGE_STATUS_EMPTY = 0,
4487 #[doc = "Storage present but unformatted."]
4488 STORAGE_STATUS_UNFORMATTED = 1,
4489 #[doc = "Storage present and ready."]
4490 STORAGE_STATUS_READY = 2,
4491 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4492 STORAGE_STATUS_NOT_SUPPORTED = 3,
4493}
4494impl StorageStatus {
4495 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4496}
4497impl Default for StorageStatus {
4498 fn default() -> Self {
4499 Self::DEFAULT
4500 }
4501}
4502#[cfg_attr(feature = "ts", derive(TS))]
4503#[cfg_attr(feature = "ts", ts(export))]
4504#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4506#[cfg_attr(feature = "serde", serde(tag = "type"))]
4507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4508#[repr(u32)]
4509#[doc = "Flags to indicate the type of storage."]
4510pub enum StorageType {
4511 #[doc = "Storage type is not known."]
4512 STORAGE_TYPE_UNKNOWN = 0,
4513 #[doc = "Storage type is USB device."]
4514 STORAGE_TYPE_USB_STICK = 1,
4515 #[doc = "Storage type is SD card."]
4516 STORAGE_TYPE_SD = 2,
4517 #[doc = "Storage type is microSD card."]
4518 STORAGE_TYPE_MICROSD = 3,
4519 #[doc = "Storage type is CFast."]
4520 STORAGE_TYPE_CF = 4,
4521 #[doc = "Storage type is CFexpress."]
4522 STORAGE_TYPE_CFE = 5,
4523 #[doc = "Storage type is XQD."]
4524 STORAGE_TYPE_XQD = 6,
4525 #[doc = "Storage type is HD mass storage type."]
4526 STORAGE_TYPE_HD = 7,
4527 #[doc = "Storage type is other, not listed type."]
4528 STORAGE_TYPE_OTHER = 254,
4529}
4530impl StorageType {
4531 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4532}
4533impl Default for StorageType {
4534 fn default() -> Self {
4535 Self::DEFAULT
4536 }
4537}
4538bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4539impl StorageUsageFlag {
4540 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4541}
4542impl Default for StorageUsageFlag {
4543 fn default() -> Self {
4544 Self::DEFAULT
4545 }
4546}
4547bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate the sensor reporting capabilities for TARGET_ABSOLUTE."] pub struct TargetAbsoluteSensorCapabilityFlags : u8 { const TARGET_ABSOLUTE_SENSOR_CAPABILITY_POSITION = 1 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_VELOCITY = 2 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_ACCELERATION = 4 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_ATTITUDE = 8 ; const TARGET_ABSOLUTE_SENSOR_CAPABILITY_RATES = 16 ; } }
4548impl TargetAbsoluteSensorCapabilityFlags {
4549 pub const DEFAULT: Self = Self::TARGET_ABSOLUTE_SENSOR_CAPABILITY_POSITION;
4550}
4551impl Default for TargetAbsoluteSensorCapabilityFlags {
4552 fn default() -> Self {
4553 Self::DEFAULT
4554 }
4555}
4556#[cfg_attr(feature = "ts", derive(TS))]
4557#[cfg_attr(feature = "ts", ts(export))]
4558#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4560#[cfg_attr(feature = "serde", serde(tag = "type"))]
4561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4562#[repr(u32)]
4563#[doc = "The frame of a target observation from an onboard sensor."]
4564pub enum TargetObsFrame {
4565 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
4566 TARGET_OBS_FRAME_LOCAL_NED = 0,
4567 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
4568 TARGET_OBS_FRAME_BODY_FRD = 1,
4569 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with an origin that travels with vehicle."]
4570 TARGET_OBS_FRAME_LOCAL_OFFSET_NED = 2,
4571 #[doc = "Other sensor frame for target observations neither in local NED nor in body FRD."]
4572 TARGET_OBS_FRAME_OTHER = 3,
4573}
4574impl TargetObsFrame {
4575 pub const DEFAULT: Self = Self::TARGET_OBS_FRAME_LOCAL_NED;
4576}
4577impl Default for TargetObsFrame {
4578 fn default() -> Self {
4579 Self::DEFAULT
4580 }
4581}
4582#[cfg_attr(feature = "ts", derive(TS))]
4583#[cfg_attr(feature = "ts", ts(export))]
4584#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4586#[cfg_attr(feature = "serde", serde(tag = "type"))]
4587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4588#[repr(u32)]
4589#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4590pub enum TuneFormat {
4591 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4592 TUNE_FORMAT_QBASIC1_1 = 1,
4593 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4594 TUNE_FORMAT_MML_MODERN = 2,
4595}
4596impl TuneFormat {
4597 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4598}
4599impl Default for TuneFormat {
4600 fn default() -> Self {
4601 Self::DEFAULT
4602 }
4603}
4604#[cfg_attr(feature = "ts", derive(TS))]
4605#[cfg_attr(feature = "ts", ts(export))]
4606#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4608#[cfg_attr(feature = "serde", serde(tag = "type"))]
4609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4610#[repr(u32)]
4611#[doc = "Generalized UAVCAN node health"]
4612pub enum UavcanNodeHealth {
4613 #[doc = "The node is functioning properly."]
4614 UAVCAN_NODE_HEALTH_OK = 0,
4615 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4616 UAVCAN_NODE_HEALTH_WARNING = 1,
4617 #[doc = "The node has encountered a major failure."]
4618 UAVCAN_NODE_HEALTH_ERROR = 2,
4619 #[doc = "The node has suffered a fatal malfunction."]
4620 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4621}
4622impl UavcanNodeHealth {
4623 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4624}
4625impl Default for UavcanNodeHealth {
4626 fn default() -> Self {
4627 Self::DEFAULT
4628 }
4629}
4630#[cfg_attr(feature = "ts", derive(TS))]
4631#[cfg_attr(feature = "ts", ts(export))]
4632#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4633#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4634#[cfg_attr(feature = "serde", serde(tag = "type"))]
4635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4636#[repr(u32)]
4637#[doc = "Generalized UAVCAN node mode"]
4638pub enum UavcanNodeMode {
4639 #[doc = "The node is performing its primary functions."]
4640 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4641 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4642 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4643 #[doc = "The node is under maintenance."]
4644 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4645 #[doc = "The node is in the process of updating its software."]
4646 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4647 #[doc = "The node is no longer available online."]
4648 UAVCAN_NODE_MODE_OFFLINE = 7,
4649}
4650impl UavcanNodeMode {
4651 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4652}
4653impl Default for UavcanNodeMode {
4654 fn default() -> Self {
4655 Self::DEFAULT
4656 }
4657}
4658bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4659impl UtmDataAvailFlags {
4660 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4661}
4662impl Default for UtmDataAvailFlags {
4663 fn default() -> Self {
4664 Self::DEFAULT
4665 }
4666}
4667#[cfg_attr(feature = "ts", derive(TS))]
4668#[cfg_attr(feature = "ts", ts(export))]
4669#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4671#[cfg_attr(feature = "serde", serde(tag = "type"))]
4672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4673#[repr(u32)]
4674#[doc = "Airborne status of UAS."]
4675pub enum UtmFlightState {
4676 #[doc = "The flight state can't be determined."]
4677 UTM_FLIGHT_STATE_UNKNOWN = 1,
4678 #[doc = "UAS on ground."]
4679 UTM_FLIGHT_STATE_GROUND = 2,
4680 #[doc = "UAS airborne."]
4681 UTM_FLIGHT_STATE_AIRBORNE = 3,
4682 #[doc = "UAS is in an emergency flight state."]
4683 UTM_FLIGHT_STATE_EMERGENCY = 16,
4684 #[doc = "UAS has no active controls."]
4685 UTM_FLIGHT_STATE_NOCTRL = 32,
4686}
4687impl UtmFlightState {
4688 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4689}
4690impl Default for UtmFlightState {
4691 fn default() -> Self {
4692 Self::DEFAULT
4693 }
4694}
4695#[cfg_attr(feature = "ts", derive(TS))]
4696#[cfg_attr(feature = "ts", ts(export))]
4697#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4699#[cfg_attr(feature = "serde", serde(tag = "type"))]
4700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4701#[repr(u32)]
4702#[doc = "Video stream encodings"]
4703pub enum VideoStreamEncoding {
4704 #[doc = "Stream encoding is unknown"]
4705 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4706 #[doc = "Stream encoding is H.264"]
4707 VIDEO_STREAM_ENCODING_H264 = 1,
4708 #[doc = "Stream encoding is H.265"]
4709 VIDEO_STREAM_ENCODING_H265 = 2,
4710}
4711impl VideoStreamEncoding {
4712 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4713}
4714impl Default for VideoStreamEncoding {
4715 fn default() -> Self {
4716 Self::DEFAULT
4717 }
4718}
4719bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4720impl VideoStreamStatusFlags {
4721 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4722}
4723impl Default for VideoStreamStatusFlags {
4724 fn default() -> Self {
4725 Self::DEFAULT
4726 }
4727}
4728#[cfg_attr(feature = "ts", derive(TS))]
4729#[cfg_attr(feature = "ts", ts(export))]
4730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4732#[cfg_attr(feature = "serde", serde(tag = "type"))]
4733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4734#[repr(u32)]
4735#[doc = "Video stream types"]
4736pub enum VideoStreamType {
4737 #[doc = "Stream is RTSP"]
4738 VIDEO_STREAM_TYPE_RTSP = 0,
4739 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4740 VIDEO_STREAM_TYPE_RTPUDP = 1,
4741 #[doc = "Stream is MPEG on TCP"]
4742 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4743 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4744 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4745}
4746impl VideoStreamType {
4747 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4748}
4749impl Default for VideoStreamType {
4750 fn default() -> Self {
4751 Self::DEFAULT
4752 }
4753}
4754#[cfg_attr(feature = "ts", derive(TS))]
4755#[cfg_attr(feature = "ts", ts(export))]
4756#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4758#[cfg_attr(feature = "serde", serde(tag = "type"))]
4759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4760#[repr(u32)]
4761#[doc = "Direction of VTOL transition"]
4762pub enum VtolTransitionHeading {
4763 #[doc = "Respect the heading configuration of the vehicle."]
4764 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4765 #[doc = "Use the heading pointing towards the next waypoint."]
4766 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4767 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4768 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4769 #[doc = "Use the specified heading in parameter 4."]
4770 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4771 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4772 VTOL_TRANSITION_HEADING_ANY = 4,
4773}
4774impl VtolTransitionHeading {
4775 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4776}
4777impl Default for VtolTransitionHeading {
4778 fn default() -> Self {
4779 Self::DEFAULT
4780 }
4781}
4782#[cfg_attr(feature = "ts", derive(TS))]
4783#[cfg_attr(feature = "ts", ts(export))]
4784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4786#[cfg_attr(feature = "serde", serde(tag = "type"))]
4787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4788#[repr(u32)]
4789#[doc = "WiFi Mode."]
4790pub enum WifiConfigApMode {
4791 #[doc = "WiFi mode is undefined."]
4792 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4793 #[doc = "WiFi configured as an access point."]
4794 WIFI_CONFIG_AP_MODE_AP = 1,
4795 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4796 WIFI_CONFIG_AP_MODE_STATION = 2,
4797 #[doc = "WiFi disabled."]
4798 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4799}
4800impl WifiConfigApMode {
4801 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4802}
4803impl Default for WifiConfigApMode {
4804 fn default() -> Self {
4805 Self::DEFAULT
4806 }
4807}
4808#[cfg_attr(feature = "ts", derive(TS))]
4809#[cfg_attr(feature = "ts", ts(export))]
4810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4812#[cfg_attr(feature = "serde", serde(tag = "type"))]
4813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4814#[repr(u32)]
4815#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4816pub enum WifiConfigApResponse {
4817 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4818 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4819 #[doc = "Changes accepted."]
4820 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4821 #[doc = "Changes rejected."]
4822 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4823 #[doc = "Invalid Mode."]
4824 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4825 #[doc = "Invalid SSID."]
4826 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4827 #[doc = "Invalid Password."]
4828 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4829}
4830impl WifiConfigApResponse {
4831 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4832}
4833impl Default for WifiConfigApResponse {
4834 fn default() -> Self {
4835 Self::DEFAULT
4836 }
4837}
4838#[cfg_attr(feature = "ts", derive(TS))]
4839#[cfg_attr(feature = "ts", ts(export))]
4840#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4842#[cfg_attr(feature = "serde", serde(tag = "type"))]
4843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4844#[repr(u32)]
4845#[doc = "Winch actions."]
4846pub enum WinchActions {
4847 #[doc = "Allow motor to freewheel."]
4848 WINCH_RELAXED = 0,
4849 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4850 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4851 #[doc = "Wind or unwind line at specified rate."]
4852 WINCH_RATE_CONTROL = 2,
4853 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4854 WINCH_LOCK = 3,
4855 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4856 WINCH_DELIVER = 4,
4857 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4858 WINCH_HOLD = 5,
4859 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4860 WINCH_RETRACT = 6,
4861 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4862 WINCH_LOAD_LINE = 7,
4863 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4864 WINCH_ABANDON_LINE = 8,
4865 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4866 WINCH_LOAD_PAYLOAD = 9,
4867}
4868impl WinchActions {
4869 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4870}
4871impl Default for WinchActions {
4872 fn default() -> Self {
4873 Self::DEFAULT
4874 }
4875}
4876#[doc = "Set the vehicle attitude and body angular rates."]
4877#[doc = ""]
4878#[doc = "ID: 140"]
4879#[derive(Debug, Clone, PartialEq)]
4880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4882#[cfg_attr(feature = "ts", derive(TS))]
4883#[cfg_attr(feature = "ts", ts(export))]
4884pub struct ACTUATOR_CONTROL_TARGET_DATA {
4885 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4886 pub time_usec: u64,
4887 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4888 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4889 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4890 pub controls: [f32; 8],
4891 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4892 pub group_mlx: u8,
4893}
4894impl ACTUATOR_CONTROL_TARGET_DATA {
4895 pub const ENCODED_LEN: usize = 41usize;
4896 pub const DEFAULT: Self = Self {
4897 time_usec: 0_u64,
4898 controls: [0.0_f32; 8usize],
4899 group_mlx: 0_u8,
4900 };
4901 #[cfg(feature = "arbitrary")]
4902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4903 use arbitrary::{Arbitrary, Unstructured};
4904 let mut buf = [0u8; 1024];
4905 rng.fill_bytes(&mut buf);
4906 let mut unstructured = Unstructured::new(&buf);
4907 Self::arbitrary(&mut unstructured).unwrap_or_default()
4908 }
4909}
4910impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4911 fn default() -> Self {
4912 Self::DEFAULT.clone()
4913 }
4914}
4915impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4916 type Message = MavMessage;
4917 const ID: u32 = 140u32;
4918 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4919 const EXTRA_CRC: u8 = 181u8;
4920 const ENCODED_LEN: usize = 41usize;
4921 fn deser(
4922 _version: MavlinkVersion,
4923 __input: &[u8],
4924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4925 let avail_len = __input.len();
4926 let mut payload_buf = [0; Self::ENCODED_LEN];
4927 let mut buf = if avail_len < Self::ENCODED_LEN {
4928 payload_buf[0..avail_len].copy_from_slice(__input);
4929 Bytes::new(&payload_buf)
4930 } else {
4931 Bytes::new(__input)
4932 };
4933 let mut __struct = Self::default();
4934 __struct.time_usec = buf.get_u64_le()?;
4935 for v in &mut __struct.controls {
4936 let val = buf.get_f32_le()?;
4937 *v = val;
4938 }
4939 __struct.group_mlx = buf.get_u8()?;
4940 Ok(__struct)
4941 }
4942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4943 let mut __tmp = BytesMut::new(bytes);
4944 #[allow(clippy::absurd_extreme_comparisons)]
4945 #[allow(unused_comparisons)]
4946 if __tmp.remaining() < Self::ENCODED_LEN {
4947 panic!(
4948 "buffer is too small (need {} bytes, but got {})",
4949 Self::ENCODED_LEN,
4950 __tmp.remaining(),
4951 )
4952 }
4953 __tmp.put_u64_le(self.time_usec);
4954 for val in &self.controls {
4955 __tmp.put_f32_le(*val);
4956 }
4957 __tmp.put_u8(self.group_mlx);
4958 if matches!(version, MavlinkVersion::V2) {
4959 let len = __tmp.len();
4960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4961 } else {
4962 __tmp.len()
4963 }
4964 }
4965}
4966#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4967#[doc = ""]
4968#[doc = "ID: 375"]
4969#[derive(Debug, Clone, PartialEq)]
4970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4972#[cfg_attr(feature = "ts", derive(TS))]
4973#[cfg_attr(feature = "ts", ts(export))]
4974pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4975 #[doc = "Timestamp (since system boot)."]
4976 pub time_usec: u64,
4977 #[doc = "Active outputs"]
4978 pub active: u32,
4979 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4981 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4982 pub actuator: [f32; 32],
4983}
4984impl ACTUATOR_OUTPUT_STATUS_DATA {
4985 pub const ENCODED_LEN: usize = 140usize;
4986 pub const DEFAULT: Self = Self {
4987 time_usec: 0_u64,
4988 active: 0_u32,
4989 actuator: [0.0_f32; 32usize],
4990 };
4991 #[cfg(feature = "arbitrary")]
4992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4993 use arbitrary::{Arbitrary, Unstructured};
4994 let mut buf = [0u8; 1024];
4995 rng.fill_bytes(&mut buf);
4996 let mut unstructured = Unstructured::new(&buf);
4997 Self::arbitrary(&mut unstructured).unwrap_or_default()
4998 }
4999}
5000impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
5001 fn default() -> Self {
5002 Self::DEFAULT.clone()
5003 }
5004}
5005impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
5006 type Message = MavMessage;
5007 const ID: u32 = 375u32;
5008 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
5009 const EXTRA_CRC: u8 = 251u8;
5010 const ENCODED_LEN: usize = 140usize;
5011 fn deser(
5012 _version: MavlinkVersion,
5013 __input: &[u8],
5014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5015 let avail_len = __input.len();
5016 let mut payload_buf = [0; Self::ENCODED_LEN];
5017 let mut buf = if avail_len < Self::ENCODED_LEN {
5018 payload_buf[0..avail_len].copy_from_slice(__input);
5019 Bytes::new(&payload_buf)
5020 } else {
5021 Bytes::new(__input)
5022 };
5023 let mut __struct = Self::default();
5024 __struct.time_usec = buf.get_u64_le()?;
5025 __struct.active = buf.get_u32_le()?;
5026 for v in &mut __struct.actuator {
5027 let val = buf.get_f32_le()?;
5028 *v = val;
5029 }
5030 Ok(__struct)
5031 }
5032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5033 let mut __tmp = BytesMut::new(bytes);
5034 #[allow(clippy::absurd_extreme_comparisons)]
5035 #[allow(unused_comparisons)]
5036 if __tmp.remaining() < Self::ENCODED_LEN {
5037 panic!(
5038 "buffer is too small (need {} bytes, but got {})",
5039 Self::ENCODED_LEN,
5040 __tmp.remaining(),
5041 )
5042 }
5043 __tmp.put_u64_le(self.time_usec);
5044 __tmp.put_u32_le(self.active);
5045 for val in &self.actuator {
5046 __tmp.put_f32_le(*val);
5047 }
5048 if matches!(version, MavlinkVersion::V2) {
5049 let len = __tmp.len();
5050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5051 } else {
5052 __tmp.len()
5053 }
5054 }
5055}
5056#[doc = "The location and information of an ADSB vehicle."]
5057#[doc = ""]
5058#[doc = "ID: 246"]
5059#[derive(Debug, Clone, PartialEq)]
5060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5062#[cfg_attr(feature = "ts", derive(TS))]
5063#[cfg_attr(feature = "ts", ts(export))]
5064pub struct ADSB_VEHICLE_DATA {
5065 #[doc = "ICAO address"]
5066 pub ICAO_address: u32,
5067 #[doc = "Latitude"]
5068 pub lat: i32,
5069 #[doc = "Longitude"]
5070 pub lon: i32,
5071 #[doc = "Altitude(ASL)"]
5072 pub altitude: i32,
5073 #[doc = "Course over ground"]
5074 pub heading: u16,
5075 #[doc = "The horizontal velocity"]
5076 pub hor_velocity: u16,
5077 #[doc = "The vertical velocity. Positive is up"]
5078 pub ver_velocity: i16,
5079 #[doc = "Bitmap to indicate various statuses including valid data fields"]
5080 pub flags: AdsbFlags,
5081 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
5082 pub squawk: u16,
5083 #[doc = "ADSB altitude type."]
5084 pub altitude_type: AdsbAltitudeType,
5085 #[doc = "The callsign, 8+null"]
5086 #[cfg_attr(feature = "ts", ts(type = "string"))]
5087 pub callsign: CharArray<9>,
5088 #[doc = "ADSB emitter type."]
5089 pub emitter_type: AdsbEmitterType,
5090 #[doc = "Time since last communication in seconds"]
5091 pub tslc: u8,
5092}
5093impl ADSB_VEHICLE_DATA {
5094 pub const ENCODED_LEN: usize = 38usize;
5095 pub const DEFAULT: Self = Self {
5096 ICAO_address: 0_u32,
5097 lat: 0_i32,
5098 lon: 0_i32,
5099 altitude: 0_i32,
5100 heading: 0_u16,
5101 hor_velocity: 0_u16,
5102 ver_velocity: 0_i16,
5103 flags: AdsbFlags::DEFAULT,
5104 squawk: 0_u16,
5105 altitude_type: AdsbAltitudeType::DEFAULT,
5106 callsign: CharArray::new([0_u8; 9usize]),
5107 emitter_type: AdsbEmitterType::DEFAULT,
5108 tslc: 0_u8,
5109 };
5110 #[cfg(feature = "arbitrary")]
5111 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5112 use arbitrary::{Arbitrary, Unstructured};
5113 let mut buf = [0u8; 1024];
5114 rng.fill_bytes(&mut buf);
5115 let mut unstructured = Unstructured::new(&buf);
5116 Self::arbitrary(&mut unstructured).unwrap_or_default()
5117 }
5118}
5119impl Default for ADSB_VEHICLE_DATA {
5120 fn default() -> Self {
5121 Self::DEFAULT.clone()
5122 }
5123}
5124impl MessageData for ADSB_VEHICLE_DATA {
5125 type Message = MavMessage;
5126 const ID: u32 = 246u32;
5127 const NAME: &'static str = "ADSB_VEHICLE";
5128 const EXTRA_CRC: u8 = 184u8;
5129 const ENCODED_LEN: usize = 38usize;
5130 fn deser(
5131 _version: MavlinkVersion,
5132 __input: &[u8],
5133 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5134 let avail_len = __input.len();
5135 let mut payload_buf = [0; Self::ENCODED_LEN];
5136 let mut buf = if avail_len < Self::ENCODED_LEN {
5137 payload_buf[0..avail_len].copy_from_slice(__input);
5138 Bytes::new(&payload_buf)
5139 } else {
5140 Bytes::new(__input)
5141 };
5142 let mut __struct = Self::default();
5143 __struct.ICAO_address = buf.get_u32_le()?;
5144 __struct.lat = buf.get_i32_le()?;
5145 __struct.lon = buf.get_i32_le()?;
5146 __struct.altitude = buf.get_i32_le()?;
5147 __struct.heading = buf.get_u16_le()?;
5148 __struct.hor_velocity = buf.get_u16_le()?;
5149 __struct.ver_velocity = buf.get_i16_le()?;
5150 let tmp = buf.get_u16_le()?;
5151 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
5152 ::mavlink_core::error::ParserError::InvalidFlag {
5153 flag_type: "AdsbFlags",
5154 value: tmp as u64,
5155 },
5156 )?;
5157 __struct.squawk = buf.get_u16_le()?;
5158 let tmp = buf.get_u8()?;
5159 __struct.altitude_type =
5160 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5161 enum_type: "AdsbAltitudeType",
5162 value: tmp as u64,
5163 })?;
5164 let mut tmp = [0_u8; 9usize];
5165 for v in &mut tmp {
5166 *v = buf.get_u8()?;
5167 }
5168 __struct.callsign = CharArray::new(tmp);
5169 let tmp = buf.get_u8()?;
5170 __struct.emitter_type =
5171 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5172 enum_type: "AdsbEmitterType",
5173 value: tmp as u64,
5174 })?;
5175 __struct.tslc = buf.get_u8()?;
5176 Ok(__struct)
5177 }
5178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5179 let mut __tmp = BytesMut::new(bytes);
5180 #[allow(clippy::absurd_extreme_comparisons)]
5181 #[allow(unused_comparisons)]
5182 if __tmp.remaining() < Self::ENCODED_LEN {
5183 panic!(
5184 "buffer is too small (need {} bytes, but got {})",
5185 Self::ENCODED_LEN,
5186 __tmp.remaining(),
5187 )
5188 }
5189 __tmp.put_u32_le(self.ICAO_address);
5190 __tmp.put_i32_le(self.lat);
5191 __tmp.put_i32_le(self.lon);
5192 __tmp.put_i32_le(self.altitude);
5193 __tmp.put_u16_le(self.heading);
5194 __tmp.put_u16_le(self.hor_velocity);
5195 __tmp.put_i16_le(self.ver_velocity);
5196 __tmp.put_u16_le(self.flags.bits() as u16);
5197 __tmp.put_u16_le(self.squawk);
5198 __tmp.put_u8(self.altitude_type as u8);
5199 for val in &self.callsign {
5200 __tmp.put_u8(*val);
5201 }
5202 __tmp.put_u8(self.emitter_type as u8);
5203 __tmp.put_u8(self.tslc);
5204 if matches!(version, MavlinkVersion::V2) {
5205 let len = __tmp.len();
5206 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5207 } else {
5208 __tmp.len()
5209 }
5210 }
5211}
5212#[doc = "Airspeed information from a sensor."]
5213#[doc = ""]
5214#[doc = "ID: 295"]
5215#[derive(Debug, Clone, PartialEq)]
5216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5218#[cfg_attr(feature = "ts", derive(TS))]
5219#[cfg_attr(feature = "ts", ts(export))]
5220pub struct AIRSPEED_DATA {
5221 #[doc = "Calibrated airspeed (CAS)."]
5222 pub airspeed: f32,
5223 #[doc = "Raw differential pressure. NaN for value unknown/not supplied."]
5224 pub raw_press: f32,
5225 #[doc = "Temperature. INT16_MAX for value unknown/not supplied."]
5226 pub temperature: i16,
5227 #[doc = "Sensor ID."]
5228 pub id: u8,
5229 #[doc = "Airspeed sensor flags."]
5230 pub flags: AirspeedSensorFlags,
5231}
5232impl AIRSPEED_DATA {
5233 pub const ENCODED_LEN: usize = 12usize;
5234 pub const DEFAULT: Self = Self {
5235 airspeed: 0.0_f32,
5236 raw_press: 0.0_f32,
5237 temperature: 0_i16,
5238 id: 0_u8,
5239 flags: AirspeedSensorFlags::DEFAULT,
5240 };
5241 #[cfg(feature = "arbitrary")]
5242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5243 use arbitrary::{Arbitrary, Unstructured};
5244 let mut buf = [0u8; 1024];
5245 rng.fill_bytes(&mut buf);
5246 let mut unstructured = Unstructured::new(&buf);
5247 Self::arbitrary(&mut unstructured).unwrap_or_default()
5248 }
5249}
5250impl Default for AIRSPEED_DATA {
5251 fn default() -> Self {
5252 Self::DEFAULT.clone()
5253 }
5254}
5255impl MessageData for AIRSPEED_DATA {
5256 type Message = MavMessage;
5257 const ID: u32 = 295u32;
5258 const NAME: &'static str = "AIRSPEED";
5259 const EXTRA_CRC: u8 = 234u8;
5260 const ENCODED_LEN: usize = 12usize;
5261 fn deser(
5262 _version: MavlinkVersion,
5263 __input: &[u8],
5264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5265 let avail_len = __input.len();
5266 let mut payload_buf = [0; Self::ENCODED_LEN];
5267 let mut buf = if avail_len < Self::ENCODED_LEN {
5268 payload_buf[0..avail_len].copy_from_slice(__input);
5269 Bytes::new(&payload_buf)
5270 } else {
5271 Bytes::new(__input)
5272 };
5273 let mut __struct = Self::default();
5274 __struct.airspeed = buf.get_f32_le()?;
5275 __struct.raw_press = buf.get_f32_le()?;
5276 __struct.temperature = buf.get_i16_le()?;
5277 __struct.id = buf.get_u8()?;
5278 let tmp = buf.get_u8()?;
5279 __struct.flags = AirspeedSensorFlags::from_bits(
5280 tmp as <AirspeedSensorFlags as Flags>::Bits,
5281 )
5282 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5283 flag_type: "AirspeedSensorFlags",
5284 value: tmp as u64,
5285 })?;
5286 Ok(__struct)
5287 }
5288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5289 let mut __tmp = BytesMut::new(bytes);
5290 #[allow(clippy::absurd_extreme_comparisons)]
5291 #[allow(unused_comparisons)]
5292 if __tmp.remaining() < Self::ENCODED_LEN {
5293 panic!(
5294 "buffer is too small (need {} bytes, but got {})",
5295 Self::ENCODED_LEN,
5296 __tmp.remaining(),
5297 )
5298 }
5299 __tmp.put_f32_le(self.airspeed);
5300 __tmp.put_f32_le(self.raw_press);
5301 __tmp.put_i16_le(self.temperature);
5302 __tmp.put_u8(self.id);
5303 __tmp.put_u8(self.flags.bits() as u8);
5304 if matches!(version, MavlinkVersion::V2) {
5305 let len = __tmp.len();
5306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5307 } else {
5308 __tmp.len()
5309 }
5310 }
5311}
5312#[doc = "The location and information of an AIS vessel."]
5313#[doc = ""]
5314#[doc = "ID: 301"]
5315#[derive(Debug, Clone, PartialEq)]
5316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5318#[cfg_attr(feature = "ts", derive(TS))]
5319#[cfg_attr(feature = "ts", ts(export))]
5320pub struct AIS_VESSEL_DATA {
5321 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5322 pub MMSI: u32,
5323 #[doc = "Latitude"]
5324 pub lat: i32,
5325 #[doc = "Longitude"]
5326 pub lon: i32,
5327 #[doc = "Course over ground"]
5328 pub COG: u16,
5329 #[doc = "True heading"]
5330 pub heading: u16,
5331 #[doc = "Speed over ground"]
5332 pub velocity: u16,
5333 #[doc = "Distance from lat/lon location to bow"]
5334 pub dimension_bow: u16,
5335 #[doc = "Distance from lat/lon location to stern"]
5336 pub dimension_stern: u16,
5337 #[doc = "Time since last communication in seconds"]
5338 pub tslc: u16,
5339 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5340 pub flags: AisFlags,
5341 #[doc = "Turn rate"]
5342 pub turn_rate: i8,
5343 #[doc = "Navigational status"]
5344 pub navigational_status: AisNavStatus,
5345 #[doc = "Type of vessels"]
5346 pub mavtype: AisType,
5347 #[doc = "Distance from lat/lon location to port side"]
5348 pub dimension_port: u8,
5349 #[doc = "Distance from lat/lon location to starboard side"]
5350 pub dimension_starboard: u8,
5351 #[doc = "The vessel callsign"]
5352 #[cfg_attr(feature = "ts", ts(type = "string"))]
5353 pub callsign: CharArray<7>,
5354 #[doc = "The vessel name"]
5355 #[cfg_attr(feature = "ts", ts(type = "string"))]
5356 pub name: CharArray<20>,
5357}
5358impl AIS_VESSEL_DATA {
5359 pub const ENCODED_LEN: usize = 58usize;
5360 pub const DEFAULT: Self = Self {
5361 MMSI: 0_u32,
5362 lat: 0_i32,
5363 lon: 0_i32,
5364 COG: 0_u16,
5365 heading: 0_u16,
5366 velocity: 0_u16,
5367 dimension_bow: 0_u16,
5368 dimension_stern: 0_u16,
5369 tslc: 0_u16,
5370 flags: AisFlags::DEFAULT,
5371 turn_rate: 0_i8,
5372 navigational_status: AisNavStatus::DEFAULT,
5373 mavtype: AisType::DEFAULT,
5374 dimension_port: 0_u8,
5375 dimension_starboard: 0_u8,
5376 callsign: CharArray::new([0_u8; 7usize]),
5377 name: CharArray::new([0_u8; 20usize]),
5378 };
5379 #[cfg(feature = "arbitrary")]
5380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5381 use arbitrary::{Arbitrary, Unstructured};
5382 let mut buf = [0u8; 1024];
5383 rng.fill_bytes(&mut buf);
5384 let mut unstructured = Unstructured::new(&buf);
5385 Self::arbitrary(&mut unstructured).unwrap_or_default()
5386 }
5387}
5388impl Default for AIS_VESSEL_DATA {
5389 fn default() -> Self {
5390 Self::DEFAULT.clone()
5391 }
5392}
5393impl MessageData for AIS_VESSEL_DATA {
5394 type Message = MavMessage;
5395 const ID: u32 = 301u32;
5396 const NAME: &'static str = "AIS_VESSEL";
5397 const EXTRA_CRC: u8 = 243u8;
5398 const ENCODED_LEN: usize = 58usize;
5399 fn deser(
5400 _version: MavlinkVersion,
5401 __input: &[u8],
5402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5403 let avail_len = __input.len();
5404 let mut payload_buf = [0; Self::ENCODED_LEN];
5405 let mut buf = if avail_len < Self::ENCODED_LEN {
5406 payload_buf[0..avail_len].copy_from_slice(__input);
5407 Bytes::new(&payload_buf)
5408 } else {
5409 Bytes::new(__input)
5410 };
5411 let mut __struct = Self::default();
5412 __struct.MMSI = buf.get_u32_le()?;
5413 __struct.lat = buf.get_i32_le()?;
5414 __struct.lon = buf.get_i32_le()?;
5415 __struct.COG = buf.get_u16_le()?;
5416 __struct.heading = buf.get_u16_le()?;
5417 __struct.velocity = buf.get_u16_le()?;
5418 __struct.dimension_bow = buf.get_u16_le()?;
5419 __struct.dimension_stern = buf.get_u16_le()?;
5420 __struct.tslc = buf.get_u16_le()?;
5421 let tmp = buf.get_u16_le()?;
5422 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5423 ::mavlink_core::error::ParserError::InvalidFlag {
5424 flag_type: "AisFlags",
5425 value: tmp as u64,
5426 },
5427 )?;
5428 __struct.turn_rate = buf.get_i8()?;
5429 let tmp = buf.get_u8()?;
5430 __struct.navigational_status =
5431 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5432 enum_type: "AisNavStatus",
5433 value: tmp as u64,
5434 })?;
5435 let tmp = buf.get_u8()?;
5436 __struct.mavtype =
5437 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5438 enum_type: "AisType",
5439 value: tmp as u64,
5440 })?;
5441 __struct.dimension_port = buf.get_u8()?;
5442 __struct.dimension_starboard = buf.get_u8()?;
5443 let mut tmp = [0_u8; 7usize];
5444 for v in &mut tmp {
5445 *v = buf.get_u8()?;
5446 }
5447 __struct.callsign = CharArray::new(tmp);
5448 let mut tmp = [0_u8; 20usize];
5449 for v in &mut tmp {
5450 *v = buf.get_u8()?;
5451 }
5452 __struct.name = CharArray::new(tmp);
5453 Ok(__struct)
5454 }
5455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5456 let mut __tmp = BytesMut::new(bytes);
5457 #[allow(clippy::absurd_extreme_comparisons)]
5458 #[allow(unused_comparisons)]
5459 if __tmp.remaining() < Self::ENCODED_LEN {
5460 panic!(
5461 "buffer is too small (need {} bytes, but got {})",
5462 Self::ENCODED_LEN,
5463 __tmp.remaining(),
5464 )
5465 }
5466 __tmp.put_u32_le(self.MMSI);
5467 __tmp.put_i32_le(self.lat);
5468 __tmp.put_i32_le(self.lon);
5469 __tmp.put_u16_le(self.COG);
5470 __tmp.put_u16_le(self.heading);
5471 __tmp.put_u16_le(self.velocity);
5472 __tmp.put_u16_le(self.dimension_bow);
5473 __tmp.put_u16_le(self.dimension_stern);
5474 __tmp.put_u16_le(self.tslc);
5475 __tmp.put_u16_le(self.flags.bits() as u16);
5476 __tmp.put_i8(self.turn_rate);
5477 __tmp.put_u8(self.navigational_status as u8);
5478 __tmp.put_u8(self.mavtype as u8);
5479 __tmp.put_u8(self.dimension_port);
5480 __tmp.put_u8(self.dimension_starboard);
5481 for val in &self.callsign {
5482 __tmp.put_u8(*val);
5483 }
5484 for val in &self.name {
5485 __tmp.put_u8(*val);
5486 }
5487 if matches!(version, MavlinkVersion::V2) {
5488 let len = __tmp.len();
5489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5490 } else {
5491 __tmp.len()
5492 }
5493 }
5494}
5495#[doc = "The current system altitude."]
5496#[doc = ""]
5497#[doc = "ID: 141"]
5498#[derive(Debug, Clone, PartialEq)]
5499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5501#[cfg_attr(feature = "ts", derive(TS))]
5502#[cfg_attr(feature = "ts", ts(export))]
5503pub struct ALTITUDE_DATA {
5504 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5505 pub time_usec: u64,
5506 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5507 pub altitude_monotonic: f32,
5508 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5509 pub altitude_amsl: f32,
5510 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5511 pub altitude_local: f32,
5512 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5513 pub altitude_relative: f32,
5514 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5515 pub altitude_terrain: f32,
5516 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5517 pub bottom_clearance: f32,
5518}
5519impl ALTITUDE_DATA {
5520 pub const ENCODED_LEN: usize = 32usize;
5521 pub const DEFAULT: Self = Self {
5522 time_usec: 0_u64,
5523 altitude_monotonic: 0.0_f32,
5524 altitude_amsl: 0.0_f32,
5525 altitude_local: 0.0_f32,
5526 altitude_relative: 0.0_f32,
5527 altitude_terrain: 0.0_f32,
5528 bottom_clearance: 0.0_f32,
5529 };
5530 #[cfg(feature = "arbitrary")]
5531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5532 use arbitrary::{Arbitrary, Unstructured};
5533 let mut buf = [0u8; 1024];
5534 rng.fill_bytes(&mut buf);
5535 let mut unstructured = Unstructured::new(&buf);
5536 Self::arbitrary(&mut unstructured).unwrap_or_default()
5537 }
5538}
5539impl Default for ALTITUDE_DATA {
5540 fn default() -> Self {
5541 Self::DEFAULT.clone()
5542 }
5543}
5544impl MessageData for ALTITUDE_DATA {
5545 type Message = MavMessage;
5546 const ID: u32 = 141u32;
5547 const NAME: &'static str = "ALTITUDE";
5548 const EXTRA_CRC: u8 = 47u8;
5549 const ENCODED_LEN: usize = 32usize;
5550 fn deser(
5551 _version: MavlinkVersion,
5552 __input: &[u8],
5553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5554 let avail_len = __input.len();
5555 let mut payload_buf = [0; Self::ENCODED_LEN];
5556 let mut buf = if avail_len < Self::ENCODED_LEN {
5557 payload_buf[0..avail_len].copy_from_slice(__input);
5558 Bytes::new(&payload_buf)
5559 } else {
5560 Bytes::new(__input)
5561 };
5562 let mut __struct = Self::default();
5563 __struct.time_usec = buf.get_u64_le()?;
5564 __struct.altitude_monotonic = buf.get_f32_le()?;
5565 __struct.altitude_amsl = buf.get_f32_le()?;
5566 __struct.altitude_local = buf.get_f32_le()?;
5567 __struct.altitude_relative = buf.get_f32_le()?;
5568 __struct.altitude_terrain = buf.get_f32_le()?;
5569 __struct.bottom_clearance = buf.get_f32_le()?;
5570 Ok(__struct)
5571 }
5572 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5573 let mut __tmp = BytesMut::new(bytes);
5574 #[allow(clippy::absurd_extreme_comparisons)]
5575 #[allow(unused_comparisons)]
5576 if __tmp.remaining() < Self::ENCODED_LEN {
5577 panic!(
5578 "buffer is too small (need {} bytes, but got {})",
5579 Self::ENCODED_LEN,
5580 __tmp.remaining(),
5581 )
5582 }
5583 __tmp.put_u64_le(self.time_usec);
5584 __tmp.put_f32_le(self.altitude_monotonic);
5585 __tmp.put_f32_le(self.altitude_amsl);
5586 __tmp.put_f32_le(self.altitude_local);
5587 __tmp.put_f32_le(self.altitude_relative);
5588 __tmp.put_f32_le(self.altitude_terrain);
5589 __tmp.put_f32_le(self.bottom_clearance);
5590 if matches!(version, MavlinkVersion::V2) {
5591 let len = __tmp.len();
5592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5593 } else {
5594 __tmp.len()
5595 }
5596 }
5597}
5598#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5599#[doc = ""]
5600#[doc = "ID: 30"]
5601#[derive(Debug, Clone, PartialEq)]
5602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5604#[cfg_attr(feature = "ts", derive(TS))]
5605#[cfg_attr(feature = "ts", ts(export))]
5606pub struct ATTITUDE_DATA {
5607 #[doc = "Timestamp (time since system boot)."]
5608 pub time_boot_ms: u32,
5609 #[doc = "Roll angle (-pi..+pi)"]
5610 pub roll: f32,
5611 #[doc = "Pitch angle (-pi..+pi)"]
5612 pub pitch: f32,
5613 #[doc = "Yaw angle (-pi..+pi)"]
5614 pub yaw: f32,
5615 #[doc = "Roll angular speed"]
5616 pub rollspeed: f32,
5617 #[doc = "Pitch angular speed"]
5618 pub pitchspeed: f32,
5619 #[doc = "Yaw angular speed"]
5620 pub yawspeed: f32,
5621}
5622impl ATTITUDE_DATA {
5623 pub const ENCODED_LEN: usize = 28usize;
5624 pub const DEFAULT: Self = Self {
5625 time_boot_ms: 0_u32,
5626 roll: 0.0_f32,
5627 pitch: 0.0_f32,
5628 yaw: 0.0_f32,
5629 rollspeed: 0.0_f32,
5630 pitchspeed: 0.0_f32,
5631 yawspeed: 0.0_f32,
5632 };
5633 #[cfg(feature = "arbitrary")]
5634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5635 use arbitrary::{Arbitrary, Unstructured};
5636 let mut buf = [0u8; 1024];
5637 rng.fill_bytes(&mut buf);
5638 let mut unstructured = Unstructured::new(&buf);
5639 Self::arbitrary(&mut unstructured).unwrap_or_default()
5640 }
5641}
5642impl Default for ATTITUDE_DATA {
5643 fn default() -> Self {
5644 Self::DEFAULT.clone()
5645 }
5646}
5647impl MessageData for ATTITUDE_DATA {
5648 type Message = MavMessage;
5649 const ID: u32 = 30u32;
5650 const NAME: &'static str = "ATTITUDE";
5651 const EXTRA_CRC: u8 = 39u8;
5652 const ENCODED_LEN: usize = 28usize;
5653 fn deser(
5654 _version: MavlinkVersion,
5655 __input: &[u8],
5656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5657 let avail_len = __input.len();
5658 let mut payload_buf = [0; Self::ENCODED_LEN];
5659 let mut buf = if avail_len < Self::ENCODED_LEN {
5660 payload_buf[0..avail_len].copy_from_slice(__input);
5661 Bytes::new(&payload_buf)
5662 } else {
5663 Bytes::new(__input)
5664 };
5665 let mut __struct = Self::default();
5666 __struct.time_boot_ms = buf.get_u32_le()?;
5667 __struct.roll = buf.get_f32_le()?;
5668 __struct.pitch = buf.get_f32_le()?;
5669 __struct.yaw = buf.get_f32_le()?;
5670 __struct.rollspeed = buf.get_f32_le()?;
5671 __struct.pitchspeed = buf.get_f32_le()?;
5672 __struct.yawspeed = buf.get_f32_le()?;
5673 Ok(__struct)
5674 }
5675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5676 let mut __tmp = BytesMut::new(bytes);
5677 #[allow(clippy::absurd_extreme_comparisons)]
5678 #[allow(unused_comparisons)]
5679 if __tmp.remaining() < Self::ENCODED_LEN {
5680 panic!(
5681 "buffer is too small (need {} bytes, but got {})",
5682 Self::ENCODED_LEN,
5683 __tmp.remaining(),
5684 )
5685 }
5686 __tmp.put_u32_le(self.time_boot_ms);
5687 __tmp.put_f32_le(self.roll);
5688 __tmp.put_f32_le(self.pitch);
5689 __tmp.put_f32_le(self.yaw);
5690 __tmp.put_f32_le(self.rollspeed);
5691 __tmp.put_f32_le(self.pitchspeed);
5692 __tmp.put_f32_le(self.yawspeed);
5693 if matches!(version, MavlinkVersion::V2) {
5694 let len = __tmp.len();
5695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5696 } else {
5697 __tmp.len()
5698 }
5699 }
5700}
5701#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5702#[doc = ""]
5703#[doc = "ID: 31"]
5704#[derive(Debug, Clone, PartialEq)]
5705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5707#[cfg_attr(feature = "ts", derive(TS))]
5708#[cfg_attr(feature = "ts", ts(export))]
5709pub struct ATTITUDE_QUATERNION_DATA {
5710 #[doc = "Timestamp (time since system boot)."]
5711 pub time_boot_ms: u32,
5712 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5713 pub q1: f32,
5714 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5715 pub q2: f32,
5716 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5717 pub q3: f32,
5718 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5719 pub q4: f32,
5720 #[doc = "Roll angular speed"]
5721 pub rollspeed: f32,
5722 #[doc = "Pitch angular speed"]
5723 pub pitchspeed: f32,
5724 #[doc = "Yaw angular speed"]
5725 pub yawspeed: f32,
5726 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5728 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5729 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5730 pub repr_offset_q: [f32; 4],
5731}
5732impl ATTITUDE_QUATERNION_DATA {
5733 pub const ENCODED_LEN: usize = 48usize;
5734 pub const DEFAULT: Self = Self {
5735 time_boot_ms: 0_u32,
5736 q1: 0.0_f32,
5737 q2: 0.0_f32,
5738 q3: 0.0_f32,
5739 q4: 0.0_f32,
5740 rollspeed: 0.0_f32,
5741 pitchspeed: 0.0_f32,
5742 yawspeed: 0.0_f32,
5743 repr_offset_q: [0.0_f32; 4usize],
5744 };
5745 #[cfg(feature = "arbitrary")]
5746 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5747 use arbitrary::{Arbitrary, Unstructured};
5748 let mut buf = [0u8; 1024];
5749 rng.fill_bytes(&mut buf);
5750 let mut unstructured = Unstructured::new(&buf);
5751 Self::arbitrary(&mut unstructured).unwrap_or_default()
5752 }
5753}
5754impl Default for ATTITUDE_QUATERNION_DATA {
5755 fn default() -> Self {
5756 Self::DEFAULT.clone()
5757 }
5758}
5759impl MessageData for ATTITUDE_QUATERNION_DATA {
5760 type Message = MavMessage;
5761 const ID: u32 = 31u32;
5762 const NAME: &'static str = "ATTITUDE_QUATERNION";
5763 const EXTRA_CRC: u8 = 246u8;
5764 const ENCODED_LEN: usize = 48usize;
5765 fn deser(
5766 _version: MavlinkVersion,
5767 __input: &[u8],
5768 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5769 let avail_len = __input.len();
5770 let mut payload_buf = [0; Self::ENCODED_LEN];
5771 let mut buf = if avail_len < Self::ENCODED_LEN {
5772 payload_buf[0..avail_len].copy_from_slice(__input);
5773 Bytes::new(&payload_buf)
5774 } else {
5775 Bytes::new(__input)
5776 };
5777 let mut __struct = Self::default();
5778 __struct.time_boot_ms = buf.get_u32_le()?;
5779 __struct.q1 = buf.get_f32_le()?;
5780 __struct.q2 = buf.get_f32_le()?;
5781 __struct.q3 = buf.get_f32_le()?;
5782 __struct.q4 = buf.get_f32_le()?;
5783 __struct.rollspeed = buf.get_f32_le()?;
5784 __struct.pitchspeed = buf.get_f32_le()?;
5785 __struct.yawspeed = buf.get_f32_le()?;
5786 for v in &mut __struct.repr_offset_q {
5787 let val = buf.get_f32_le()?;
5788 *v = val;
5789 }
5790 Ok(__struct)
5791 }
5792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5793 let mut __tmp = BytesMut::new(bytes);
5794 #[allow(clippy::absurd_extreme_comparisons)]
5795 #[allow(unused_comparisons)]
5796 if __tmp.remaining() < Self::ENCODED_LEN {
5797 panic!(
5798 "buffer is too small (need {} bytes, but got {})",
5799 Self::ENCODED_LEN,
5800 __tmp.remaining(),
5801 )
5802 }
5803 __tmp.put_u32_le(self.time_boot_ms);
5804 __tmp.put_f32_le(self.q1);
5805 __tmp.put_f32_le(self.q2);
5806 __tmp.put_f32_le(self.q3);
5807 __tmp.put_f32_le(self.q4);
5808 __tmp.put_f32_le(self.rollspeed);
5809 __tmp.put_f32_le(self.pitchspeed);
5810 __tmp.put_f32_le(self.yawspeed);
5811 if matches!(version, MavlinkVersion::V2) {
5812 for val in &self.repr_offset_q {
5813 __tmp.put_f32_le(*val);
5814 }
5815 let len = __tmp.len();
5816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5817 } else {
5818 __tmp.len()
5819 }
5820 }
5821}
5822#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5823#[doc = ""]
5824#[doc = "ID: 61"]
5825#[derive(Debug, Clone, PartialEq)]
5826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5828#[cfg_attr(feature = "ts", derive(TS))]
5829#[cfg_attr(feature = "ts", ts(export))]
5830pub struct ATTITUDE_QUATERNION_COV_DATA {
5831 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5832 pub time_usec: u64,
5833 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5836 pub q: [f32; 4],
5837 #[doc = "Roll angular speed"]
5838 pub rollspeed: f32,
5839 #[doc = "Pitch angular speed"]
5840 pub pitchspeed: f32,
5841 #[doc = "Yaw angular speed"]
5842 pub yawspeed: f32,
5843 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5844 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5845 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5846 pub covariance: [f32; 9],
5847}
5848impl ATTITUDE_QUATERNION_COV_DATA {
5849 pub const ENCODED_LEN: usize = 72usize;
5850 pub const DEFAULT: Self = Self {
5851 time_usec: 0_u64,
5852 q: [0.0_f32; 4usize],
5853 rollspeed: 0.0_f32,
5854 pitchspeed: 0.0_f32,
5855 yawspeed: 0.0_f32,
5856 covariance: [0.0_f32; 9usize],
5857 };
5858 #[cfg(feature = "arbitrary")]
5859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5860 use arbitrary::{Arbitrary, Unstructured};
5861 let mut buf = [0u8; 1024];
5862 rng.fill_bytes(&mut buf);
5863 let mut unstructured = Unstructured::new(&buf);
5864 Self::arbitrary(&mut unstructured).unwrap_or_default()
5865 }
5866}
5867impl Default for ATTITUDE_QUATERNION_COV_DATA {
5868 fn default() -> Self {
5869 Self::DEFAULT.clone()
5870 }
5871}
5872impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5873 type Message = MavMessage;
5874 const ID: u32 = 61u32;
5875 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5876 const EXTRA_CRC: u8 = 167u8;
5877 const ENCODED_LEN: usize = 72usize;
5878 fn deser(
5879 _version: MavlinkVersion,
5880 __input: &[u8],
5881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5882 let avail_len = __input.len();
5883 let mut payload_buf = [0; Self::ENCODED_LEN];
5884 let mut buf = if avail_len < Self::ENCODED_LEN {
5885 payload_buf[0..avail_len].copy_from_slice(__input);
5886 Bytes::new(&payload_buf)
5887 } else {
5888 Bytes::new(__input)
5889 };
5890 let mut __struct = Self::default();
5891 __struct.time_usec = buf.get_u64_le()?;
5892 for v in &mut __struct.q {
5893 let val = buf.get_f32_le()?;
5894 *v = val;
5895 }
5896 __struct.rollspeed = buf.get_f32_le()?;
5897 __struct.pitchspeed = buf.get_f32_le()?;
5898 __struct.yawspeed = buf.get_f32_le()?;
5899 for v in &mut __struct.covariance {
5900 let val = buf.get_f32_le()?;
5901 *v = val;
5902 }
5903 Ok(__struct)
5904 }
5905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5906 let mut __tmp = BytesMut::new(bytes);
5907 #[allow(clippy::absurd_extreme_comparisons)]
5908 #[allow(unused_comparisons)]
5909 if __tmp.remaining() < Self::ENCODED_LEN {
5910 panic!(
5911 "buffer is too small (need {} bytes, but got {})",
5912 Self::ENCODED_LEN,
5913 __tmp.remaining(),
5914 )
5915 }
5916 __tmp.put_u64_le(self.time_usec);
5917 for val in &self.q {
5918 __tmp.put_f32_le(*val);
5919 }
5920 __tmp.put_f32_le(self.rollspeed);
5921 __tmp.put_f32_le(self.pitchspeed);
5922 __tmp.put_f32_le(self.yawspeed);
5923 for val in &self.covariance {
5924 __tmp.put_f32_le(*val);
5925 }
5926 if matches!(version, MavlinkVersion::V2) {
5927 let len = __tmp.len();
5928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5929 } else {
5930 __tmp.len()
5931 }
5932 }
5933}
5934#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5935#[doc = ""]
5936#[doc = "ID: 83"]
5937#[derive(Debug, Clone, PartialEq)]
5938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5940#[cfg_attr(feature = "ts", derive(TS))]
5941#[cfg_attr(feature = "ts", ts(export))]
5942pub struct ATTITUDE_TARGET_DATA {
5943 #[doc = "Timestamp (time since system boot)."]
5944 pub time_boot_ms: u32,
5945 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5947 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5948 pub q: [f32; 4],
5949 #[doc = "Body roll rate"]
5950 pub body_roll_rate: f32,
5951 #[doc = "Body pitch rate"]
5952 pub body_pitch_rate: f32,
5953 #[doc = "Body yaw rate"]
5954 pub body_yaw_rate: f32,
5955 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5956 pub thrust: f32,
5957 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5958 pub type_mask: AttitudeTargetTypemask,
5959}
5960impl ATTITUDE_TARGET_DATA {
5961 pub const ENCODED_LEN: usize = 37usize;
5962 pub const DEFAULT: Self = Self {
5963 time_boot_ms: 0_u32,
5964 q: [0.0_f32; 4usize],
5965 body_roll_rate: 0.0_f32,
5966 body_pitch_rate: 0.0_f32,
5967 body_yaw_rate: 0.0_f32,
5968 thrust: 0.0_f32,
5969 type_mask: AttitudeTargetTypemask::DEFAULT,
5970 };
5971 #[cfg(feature = "arbitrary")]
5972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5973 use arbitrary::{Arbitrary, Unstructured};
5974 let mut buf = [0u8; 1024];
5975 rng.fill_bytes(&mut buf);
5976 let mut unstructured = Unstructured::new(&buf);
5977 Self::arbitrary(&mut unstructured).unwrap_or_default()
5978 }
5979}
5980impl Default for ATTITUDE_TARGET_DATA {
5981 fn default() -> Self {
5982 Self::DEFAULT.clone()
5983 }
5984}
5985impl MessageData for ATTITUDE_TARGET_DATA {
5986 type Message = MavMessage;
5987 const ID: u32 = 83u32;
5988 const NAME: &'static str = "ATTITUDE_TARGET";
5989 const EXTRA_CRC: u8 = 22u8;
5990 const ENCODED_LEN: usize = 37usize;
5991 fn deser(
5992 _version: MavlinkVersion,
5993 __input: &[u8],
5994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5995 let avail_len = __input.len();
5996 let mut payload_buf = [0; Self::ENCODED_LEN];
5997 let mut buf = if avail_len < Self::ENCODED_LEN {
5998 payload_buf[0..avail_len].copy_from_slice(__input);
5999 Bytes::new(&payload_buf)
6000 } else {
6001 Bytes::new(__input)
6002 };
6003 let mut __struct = Self::default();
6004 __struct.time_boot_ms = buf.get_u32_le()?;
6005 for v in &mut __struct.q {
6006 let val = buf.get_f32_le()?;
6007 *v = val;
6008 }
6009 __struct.body_roll_rate = buf.get_f32_le()?;
6010 __struct.body_pitch_rate = buf.get_f32_le()?;
6011 __struct.body_yaw_rate = buf.get_f32_le()?;
6012 __struct.thrust = buf.get_f32_le()?;
6013 let tmp = buf.get_u8()?;
6014 __struct.type_mask =
6015 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
6016 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6017 flag_type: "AttitudeTargetTypemask",
6018 value: tmp as u64,
6019 })?;
6020 Ok(__struct)
6021 }
6022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6023 let mut __tmp = BytesMut::new(bytes);
6024 #[allow(clippy::absurd_extreme_comparisons)]
6025 #[allow(unused_comparisons)]
6026 if __tmp.remaining() < Self::ENCODED_LEN {
6027 panic!(
6028 "buffer is too small (need {} bytes, but got {})",
6029 Self::ENCODED_LEN,
6030 __tmp.remaining(),
6031 )
6032 }
6033 __tmp.put_u32_le(self.time_boot_ms);
6034 for val in &self.q {
6035 __tmp.put_f32_le(*val);
6036 }
6037 __tmp.put_f32_le(self.body_roll_rate);
6038 __tmp.put_f32_le(self.body_pitch_rate);
6039 __tmp.put_f32_le(self.body_yaw_rate);
6040 __tmp.put_f32_le(self.thrust);
6041 __tmp.put_u8(self.type_mask.bits() as u8);
6042 if matches!(version, MavlinkVersion::V2) {
6043 let len = __tmp.len();
6044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6045 } else {
6046 __tmp.len()
6047 }
6048 }
6049}
6050#[doc = "Motion capture attitude and position."]
6051#[doc = ""]
6052#[doc = "ID: 138"]
6053#[derive(Debug, Clone, PartialEq)]
6054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6056#[cfg_attr(feature = "ts", derive(TS))]
6057#[cfg_attr(feature = "ts", ts(export))]
6058pub struct ATT_POS_MOCAP_DATA {
6059 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6060 pub time_usec: u64,
6061 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6063 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6064 pub q: [f32; 4],
6065 #[doc = "X position (NED)"]
6066 pub x: f32,
6067 #[doc = "Y position (NED)"]
6068 pub y: f32,
6069 #[doc = "Z position (NED)"]
6070 pub z: f32,
6071 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6072 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6073 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6074 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6075 pub covariance: [f32; 21],
6076}
6077impl ATT_POS_MOCAP_DATA {
6078 pub const ENCODED_LEN: usize = 120usize;
6079 pub const DEFAULT: Self = Self {
6080 time_usec: 0_u64,
6081 q: [0.0_f32; 4usize],
6082 x: 0.0_f32,
6083 y: 0.0_f32,
6084 z: 0.0_f32,
6085 covariance: [0.0_f32; 21usize],
6086 };
6087 #[cfg(feature = "arbitrary")]
6088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6089 use arbitrary::{Arbitrary, Unstructured};
6090 let mut buf = [0u8; 1024];
6091 rng.fill_bytes(&mut buf);
6092 let mut unstructured = Unstructured::new(&buf);
6093 Self::arbitrary(&mut unstructured).unwrap_or_default()
6094 }
6095}
6096impl Default for ATT_POS_MOCAP_DATA {
6097 fn default() -> Self {
6098 Self::DEFAULT.clone()
6099 }
6100}
6101impl MessageData for ATT_POS_MOCAP_DATA {
6102 type Message = MavMessage;
6103 const ID: u32 = 138u32;
6104 const NAME: &'static str = "ATT_POS_MOCAP";
6105 const EXTRA_CRC: u8 = 109u8;
6106 const ENCODED_LEN: usize = 120usize;
6107 fn deser(
6108 _version: MavlinkVersion,
6109 __input: &[u8],
6110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6111 let avail_len = __input.len();
6112 let mut payload_buf = [0; Self::ENCODED_LEN];
6113 let mut buf = if avail_len < Self::ENCODED_LEN {
6114 payload_buf[0..avail_len].copy_from_slice(__input);
6115 Bytes::new(&payload_buf)
6116 } else {
6117 Bytes::new(__input)
6118 };
6119 let mut __struct = Self::default();
6120 __struct.time_usec = buf.get_u64_le()?;
6121 for v in &mut __struct.q {
6122 let val = buf.get_f32_le()?;
6123 *v = val;
6124 }
6125 __struct.x = buf.get_f32_le()?;
6126 __struct.y = buf.get_f32_le()?;
6127 __struct.z = buf.get_f32_le()?;
6128 for v in &mut __struct.covariance {
6129 let val = buf.get_f32_le()?;
6130 *v = val;
6131 }
6132 Ok(__struct)
6133 }
6134 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6135 let mut __tmp = BytesMut::new(bytes);
6136 #[allow(clippy::absurd_extreme_comparisons)]
6137 #[allow(unused_comparisons)]
6138 if __tmp.remaining() < Self::ENCODED_LEN {
6139 panic!(
6140 "buffer is too small (need {} bytes, but got {})",
6141 Self::ENCODED_LEN,
6142 __tmp.remaining(),
6143 )
6144 }
6145 __tmp.put_u64_le(self.time_usec);
6146 for val in &self.q {
6147 __tmp.put_f32_le(*val);
6148 }
6149 __tmp.put_f32_le(self.x);
6150 __tmp.put_f32_le(self.y);
6151 __tmp.put_f32_le(self.z);
6152 if matches!(version, MavlinkVersion::V2) {
6153 for val in &self.covariance {
6154 __tmp.put_f32_le(*val);
6155 }
6156 let len = __tmp.len();
6157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6158 } else {
6159 __tmp.len()
6160 }
6161 }
6162}
6163#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6164#[doc = ""]
6165#[doc = "ID: 7"]
6166#[derive(Debug, Clone, PartialEq)]
6167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6169#[cfg_attr(feature = "ts", derive(TS))]
6170#[cfg_attr(feature = "ts", ts(export))]
6171pub struct AUTH_KEY_DATA {
6172 #[doc = "key"]
6173 #[cfg_attr(feature = "ts", ts(type = "string"))]
6174 pub key: CharArray<32>,
6175}
6176impl AUTH_KEY_DATA {
6177 pub const ENCODED_LEN: usize = 32usize;
6178 pub const DEFAULT: Self = Self {
6179 key: CharArray::new([0_u8; 32usize]),
6180 };
6181 #[cfg(feature = "arbitrary")]
6182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6183 use arbitrary::{Arbitrary, Unstructured};
6184 let mut buf = [0u8; 1024];
6185 rng.fill_bytes(&mut buf);
6186 let mut unstructured = Unstructured::new(&buf);
6187 Self::arbitrary(&mut unstructured).unwrap_or_default()
6188 }
6189}
6190impl Default for AUTH_KEY_DATA {
6191 fn default() -> Self {
6192 Self::DEFAULT.clone()
6193 }
6194}
6195impl MessageData for AUTH_KEY_DATA {
6196 type Message = MavMessage;
6197 const ID: u32 = 7u32;
6198 const NAME: &'static str = "AUTH_KEY";
6199 const EXTRA_CRC: u8 = 119u8;
6200 const ENCODED_LEN: usize = 32usize;
6201 fn deser(
6202 _version: MavlinkVersion,
6203 __input: &[u8],
6204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6205 let avail_len = __input.len();
6206 let mut payload_buf = [0; Self::ENCODED_LEN];
6207 let mut buf = if avail_len < Self::ENCODED_LEN {
6208 payload_buf[0..avail_len].copy_from_slice(__input);
6209 Bytes::new(&payload_buf)
6210 } else {
6211 Bytes::new(__input)
6212 };
6213 let mut __struct = Self::default();
6214 let mut tmp = [0_u8; 32usize];
6215 for v in &mut tmp {
6216 *v = buf.get_u8()?;
6217 }
6218 __struct.key = CharArray::new(tmp);
6219 Ok(__struct)
6220 }
6221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6222 let mut __tmp = BytesMut::new(bytes);
6223 #[allow(clippy::absurd_extreme_comparisons)]
6224 #[allow(unused_comparisons)]
6225 if __tmp.remaining() < Self::ENCODED_LEN {
6226 panic!(
6227 "buffer is too small (need {} bytes, but got {})",
6228 Self::ENCODED_LEN,
6229 __tmp.remaining(),
6230 )
6231 }
6232 for val in &self.key {
6233 __tmp.put_u8(*val);
6234 }
6235 if matches!(version, MavlinkVersion::V2) {
6236 let len = __tmp.len();
6237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6238 } else {
6239 __tmp.len()
6240 }
6241 }
6242}
6243#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6244#[doc = ""]
6245#[doc = "ID: 286"]
6246#[derive(Debug, Clone, PartialEq)]
6247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6249#[cfg_attr(feature = "ts", derive(TS))]
6250#[cfg_attr(feature = "ts", ts(export))]
6251pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6252 #[doc = "Timestamp (time since system boot)."]
6253 pub time_boot_us: u64,
6254 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6255 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6256 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6257 pub q: [f32; 4],
6258 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6259 pub q_estimated_delay_us: u32,
6260 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6261 pub vx: f32,
6262 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6263 pub vy: f32,
6264 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6265 pub vz: f32,
6266 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6267 pub v_estimated_delay_us: u32,
6268 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6269 pub feed_forward_angular_velocity_z: f32,
6270 #[doc = "Bitmap indicating which estimator outputs are valid."]
6271 pub estimator_status: EstimatorStatusFlags,
6272 #[doc = "System ID"]
6273 pub target_system: u8,
6274 #[doc = "Component ID"]
6275 pub target_component: u8,
6276 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6277 pub landed_state: MavLandedState,
6278 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6279 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6280 pub angular_velocity_z: f32,
6281}
6282impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6283 pub const ENCODED_LEN: usize = 57usize;
6284 pub const DEFAULT: Self = Self {
6285 time_boot_us: 0_u64,
6286 q: [0.0_f32; 4usize],
6287 q_estimated_delay_us: 0_u32,
6288 vx: 0.0_f32,
6289 vy: 0.0_f32,
6290 vz: 0.0_f32,
6291 v_estimated_delay_us: 0_u32,
6292 feed_forward_angular_velocity_z: 0.0_f32,
6293 estimator_status: EstimatorStatusFlags::DEFAULT,
6294 target_system: 0_u8,
6295 target_component: 0_u8,
6296 landed_state: MavLandedState::DEFAULT,
6297 angular_velocity_z: 0.0_f32,
6298 };
6299 #[cfg(feature = "arbitrary")]
6300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6301 use arbitrary::{Arbitrary, Unstructured};
6302 let mut buf = [0u8; 1024];
6303 rng.fill_bytes(&mut buf);
6304 let mut unstructured = Unstructured::new(&buf);
6305 Self::arbitrary(&mut unstructured).unwrap_or_default()
6306 }
6307}
6308impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6309 fn default() -> Self {
6310 Self::DEFAULT.clone()
6311 }
6312}
6313impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6314 type Message = MavMessage;
6315 const ID: u32 = 286u32;
6316 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6317 const EXTRA_CRC: u8 = 210u8;
6318 const ENCODED_LEN: usize = 57usize;
6319 fn deser(
6320 _version: MavlinkVersion,
6321 __input: &[u8],
6322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6323 let avail_len = __input.len();
6324 let mut payload_buf = [0; Self::ENCODED_LEN];
6325 let mut buf = if avail_len < Self::ENCODED_LEN {
6326 payload_buf[0..avail_len].copy_from_slice(__input);
6327 Bytes::new(&payload_buf)
6328 } else {
6329 Bytes::new(__input)
6330 };
6331 let mut __struct = Self::default();
6332 __struct.time_boot_us = buf.get_u64_le()?;
6333 for v in &mut __struct.q {
6334 let val = buf.get_f32_le()?;
6335 *v = val;
6336 }
6337 __struct.q_estimated_delay_us = buf.get_u32_le()?;
6338 __struct.vx = buf.get_f32_le()?;
6339 __struct.vy = buf.get_f32_le()?;
6340 __struct.vz = buf.get_f32_le()?;
6341 __struct.v_estimated_delay_us = buf.get_u32_le()?;
6342 __struct.feed_forward_angular_velocity_z = buf.get_f32_le()?;
6343 let tmp = buf.get_u16_le()?;
6344 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6345 tmp as <EstimatorStatusFlags as Flags>::Bits,
6346 )
6347 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6348 flag_type: "EstimatorStatusFlags",
6349 value: tmp as u64,
6350 })?;
6351 __struct.target_system = buf.get_u8()?;
6352 __struct.target_component = buf.get_u8()?;
6353 let tmp = buf.get_u8()?;
6354 __struct.landed_state =
6355 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6356 enum_type: "MavLandedState",
6357 value: tmp as u64,
6358 })?;
6359 __struct.angular_velocity_z = buf.get_f32_le()?;
6360 Ok(__struct)
6361 }
6362 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6363 let mut __tmp = BytesMut::new(bytes);
6364 #[allow(clippy::absurd_extreme_comparisons)]
6365 #[allow(unused_comparisons)]
6366 if __tmp.remaining() < Self::ENCODED_LEN {
6367 panic!(
6368 "buffer is too small (need {} bytes, but got {})",
6369 Self::ENCODED_LEN,
6370 __tmp.remaining(),
6371 )
6372 }
6373 __tmp.put_u64_le(self.time_boot_us);
6374 for val in &self.q {
6375 __tmp.put_f32_le(*val);
6376 }
6377 __tmp.put_u32_le(self.q_estimated_delay_us);
6378 __tmp.put_f32_le(self.vx);
6379 __tmp.put_f32_le(self.vy);
6380 __tmp.put_f32_le(self.vz);
6381 __tmp.put_u32_le(self.v_estimated_delay_us);
6382 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6383 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6384 __tmp.put_u8(self.target_system);
6385 __tmp.put_u8(self.target_component);
6386 __tmp.put_u8(self.landed_state as u8);
6387 if matches!(version, MavlinkVersion::V2) {
6388 __tmp.put_f32_le(self.angular_velocity_z);
6389 let len = __tmp.len();
6390 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6391 } else {
6392 __tmp.len()
6393 }
6394 }
6395}
6396#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6397#[doc = ""]
6398#[doc = "ID: 148"]
6399#[derive(Debug, Clone, PartialEq)]
6400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6402#[cfg_attr(feature = "ts", derive(TS))]
6403#[cfg_attr(feature = "ts", ts(export))]
6404pub struct AUTOPILOT_VERSION_DATA {
6405 #[doc = "Bitmap of capabilities"]
6406 pub capabilities: MavProtocolCapability,
6407 #[doc = "UID if provided by hardware (see uid2)"]
6408 pub uid: u64,
6409 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6410 pub flight_sw_version: u32,
6411 #[doc = "Middleware version number"]
6412 pub middleware_sw_version: u32,
6413 #[doc = "Operating system version number"]
6414 pub os_sw_version: u32,
6415 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6416 pub board_version: u32,
6417 #[doc = "ID of the board vendor"]
6418 pub vendor_id: u16,
6419 #[doc = "ID of the product"]
6420 pub product_id: u16,
6421 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6422 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6423 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6424 pub flight_custom_version: [u8; 8],
6425 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6428 pub middleware_custom_version: [u8; 8],
6429 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6431 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6432 pub os_custom_version: [u8; 8],
6433 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6436 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6437 pub uid2: [u8; 18],
6438}
6439impl AUTOPILOT_VERSION_DATA {
6440 pub const ENCODED_LEN: usize = 78usize;
6441 pub const DEFAULT: Self = Self {
6442 capabilities: MavProtocolCapability::DEFAULT,
6443 uid: 0_u64,
6444 flight_sw_version: 0_u32,
6445 middleware_sw_version: 0_u32,
6446 os_sw_version: 0_u32,
6447 board_version: 0_u32,
6448 vendor_id: 0_u16,
6449 product_id: 0_u16,
6450 flight_custom_version: [0_u8; 8usize],
6451 middleware_custom_version: [0_u8; 8usize],
6452 os_custom_version: [0_u8; 8usize],
6453 uid2: [0_u8; 18usize],
6454 };
6455 #[cfg(feature = "arbitrary")]
6456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6457 use arbitrary::{Arbitrary, Unstructured};
6458 let mut buf = [0u8; 1024];
6459 rng.fill_bytes(&mut buf);
6460 let mut unstructured = Unstructured::new(&buf);
6461 Self::arbitrary(&mut unstructured).unwrap_or_default()
6462 }
6463}
6464impl Default for AUTOPILOT_VERSION_DATA {
6465 fn default() -> Self {
6466 Self::DEFAULT.clone()
6467 }
6468}
6469impl MessageData for AUTOPILOT_VERSION_DATA {
6470 type Message = MavMessage;
6471 const ID: u32 = 148u32;
6472 const NAME: &'static str = "AUTOPILOT_VERSION";
6473 const EXTRA_CRC: u8 = 178u8;
6474 const ENCODED_LEN: usize = 78usize;
6475 fn deser(
6476 _version: MavlinkVersion,
6477 __input: &[u8],
6478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6479 let avail_len = __input.len();
6480 let mut payload_buf = [0; Self::ENCODED_LEN];
6481 let mut buf = if avail_len < Self::ENCODED_LEN {
6482 payload_buf[0..avail_len].copy_from_slice(__input);
6483 Bytes::new(&payload_buf)
6484 } else {
6485 Bytes::new(__input)
6486 };
6487 let mut __struct = Self::default();
6488 let tmp = buf.get_u64_le()?;
6489 __struct.capabilities = MavProtocolCapability::from_bits(
6490 tmp as <MavProtocolCapability as Flags>::Bits,
6491 )
6492 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6493 flag_type: "MavProtocolCapability",
6494 value: tmp as u64,
6495 })?;
6496 __struct.uid = buf.get_u64_le()?;
6497 __struct.flight_sw_version = buf.get_u32_le()?;
6498 __struct.middleware_sw_version = buf.get_u32_le()?;
6499 __struct.os_sw_version = buf.get_u32_le()?;
6500 __struct.board_version = buf.get_u32_le()?;
6501 __struct.vendor_id = buf.get_u16_le()?;
6502 __struct.product_id = buf.get_u16_le()?;
6503 for v in &mut __struct.flight_custom_version {
6504 let val = buf.get_u8()?;
6505 *v = val;
6506 }
6507 for v in &mut __struct.middleware_custom_version {
6508 let val = buf.get_u8()?;
6509 *v = val;
6510 }
6511 for v in &mut __struct.os_custom_version {
6512 let val = buf.get_u8()?;
6513 *v = val;
6514 }
6515 for v in &mut __struct.uid2 {
6516 let val = buf.get_u8()?;
6517 *v = val;
6518 }
6519 Ok(__struct)
6520 }
6521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6522 let mut __tmp = BytesMut::new(bytes);
6523 #[allow(clippy::absurd_extreme_comparisons)]
6524 #[allow(unused_comparisons)]
6525 if __tmp.remaining() < Self::ENCODED_LEN {
6526 panic!(
6527 "buffer is too small (need {} bytes, but got {})",
6528 Self::ENCODED_LEN,
6529 __tmp.remaining(),
6530 )
6531 }
6532 __tmp.put_u64_le(self.capabilities.bits() as u64);
6533 __tmp.put_u64_le(self.uid);
6534 __tmp.put_u32_le(self.flight_sw_version);
6535 __tmp.put_u32_le(self.middleware_sw_version);
6536 __tmp.put_u32_le(self.os_sw_version);
6537 __tmp.put_u32_le(self.board_version);
6538 __tmp.put_u16_le(self.vendor_id);
6539 __tmp.put_u16_le(self.product_id);
6540 for val in &self.flight_custom_version {
6541 __tmp.put_u8(*val);
6542 }
6543 for val in &self.middleware_custom_version {
6544 __tmp.put_u8(*val);
6545 }
6546 for val in &self.os_custom_version {
6547 __tmp.put_u8(*val);
6548 }
6549 if matches!(version, MavlinkVersion::V2) {
6550 for val in &self.uid2 {
6551 __tmp.put_u8(*val);
6552 }
6553 let len = __tmp.len();
6554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6555 } else {
6556 __tmp.len()
6557 }
6558 }
6559}
6560#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6561#[doc = ""]
6562#[doc = "ID: 435"]
6563#[derive(Debug, Clone, PartialEq)]
6564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6566#[cfg_attr(feature = "ts", derive(TS))]
6567#[cfg_attr(feature = "ts", ts(export))]
6568pub struct AVAILABLE_MODES_DATA {
6569 #[doc = "A bitfield for use for autopilot-specific flags"]
6570 pub custom_mode: u32,
6571 #[doc = "Mode properties."]
6572 pub properties: MavModeProperty,
6573 #[doc = "The total number of available modes for the current vehicle type."]
6574 pub number_modes: u8,
6575 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6576 pub mode_index: u8,
6577 #[doc = "Standard mode."]
6578 pub standard_mode: MavStandardMode,
6579 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6580 #[cfg_attr(feature = "ts", ts(type = "string"))]
6581 pub mode_name: CharArray<35>,
6582}
6583impl AVAILABLE_MODES_DATA {
6584 pub const ENCODED_LEN: usize = 46usize;
6585 pub const DEFAULT: Self = Self {
6586 custom_mode: 0_u32,
6587 properties: MavModeProperty::DEFAULT,
6588 number_modes: 0_u8,
6589 mode_index: 0_u8,
6590 standard_mode: MavStandardMode::DEFAULT,
6591 mode_name: CharArray::new([0_u8; 35usize]),
6592 };
6593 #[cfg(feature = "arbitrary")]
6594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6595 use arbitrary::{Arbitrary, Unstructured};
6596 let mut buf = [0u8; 1024];
6597 rng.fill_bytes(&mut buf);
6598 let mut unstructured = Unstructured::new(&buf);
6599 Self::arbitrary(&mut unstructured).unwrap_or_default()
6600 }
6601}
6602impl Default for AVAILABLE_MODES_DATA {
6603 fn default() -> Self {
6604 Self::DEFAULT.clone()
6605 }
6606}
6607impl MessageData for AVAILABLE_MODES_DATA {
6608 type Message = MavMessage;
6609 const ID: u32 = 435u32;
6610 const NAME: &'static str = "AVAILABLE_MODES";
6611 const EXTRA_CRC: u8 = 134u8;
6612 const ENCODED_LEN: usize = 46usize;
6613 fn deser(
6614 _version: MavlinkVersion,
6615 __input: &[u8],
6616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6617 let avail_len = __input.len();
6618 let mut payload_buf = [0; Self::ENCODED_LEN];
6619 let mut buf = if avail_len < Self::ENCODED_LEN {
6620 payload_buf[0..avail_len].copy_from_slice(__input);
6621 Bytes::new(&payload_buf)
6622 } else {
6623 Bytes::new(__input)
6624 };
6625 let mut __struct = Self::default();
6626 __struct.custom_mode = buf.get_u32_le()?;
6627 let tmp = buf.get_u32_le()?;
6628 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6629 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6630 flag_type: "MavModeProperty",
6631 value: tmp as u64,
6632 })?;
6633 __struct.number_modes = buf.get_u8()?;
6634 __struct.mode_index = buf.get_u8()?;
6635 let tmp = buf.get_u8()?;
6636 __struct.standard_mode =
6637 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6638 enum_type: "MavStandardMode",
6639 value: tmp as u64,
6640 })?;
6641 let mut tmp = [0_u8; 35usize];
6642 for v in &mut tmp {
6643 *v = buf.get_u8()?;
6644 }
6645 __struct.mode_name = CharArray::new(tmp);
6646 Ok(__struct)
6647 }
6648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6649 let mut __tmp = BytesMut::new(bytes);
6650 #[allow(clippy::absurd_extreme_comparisons)]
6651 #[allow(unused_comparisons)]
6652 if __tmp.remaining() < Self::ENCODED_LEN {
6653 panic!(
6654 "buffer is too small (need {} bytes, but got {})",
6655 Self::ENCODED_LEN,
6656 __tmp.remaining(),
6657 )
6658 }
6659 __tmp.put_u32_le(self.custom_mode);
6660 __tmp.put_u32_le(self.properties.bits() as u32);
6661 __tmp.put_u8(self.number_modes);
6662 __tmp.put_u8(self.mode_index);
6663 __tmp.put_u8(self.standard_mode as u8);
6664 for val in &self.mode_name {
6665 __tmp.put_u8(*val);
6666 }
6667 if matches!(version, MavlinkVersion::V2) {
6668 let len = __tmp.len();
6669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6670 } else {
6671 __tmp.len()
6672 }
6673 }
6674}
6675#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6676#[doc = ""]
6677#[doc = "ID: 437"]
6678#[derive(Debug, Clone, PartialEq)]
6679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6681#[cfg_attr(feature = "ts", derive(TS))]
6682#[cfg_attr(feature = "ts", ts(export))]
6683pub struct AVAILABLE_MODES_MONITOR_DATA {
6684 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6685 pub seq: u8,
6686}
6687impl AVAILABLE_MODES_MONITOR_DATA {
6688 pub const ENCODED_LEN: usize = 1usize;
6689 pub const DEFAULT: Self = Self { seq: 0_u8 };
6690 #[cfg(feature = "arbitrary")]
6691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6692 use arbitrary::{Arbitrary, Unstructured};
6693 let mut buf = [0u8; 1024];
6694 rng.fill_bytes(&mut buf);
6695 let mut unstructured = Unstructured::new(&buf);
6696 Self::arbitrary(&mut unstructured).unwrap_or_default()
6697 }
6698}
6699impl Default for AVAILABLE_MODES_MONITOR_DATA {
6700 fn default() -> Self {
6701 Self::DEFAULT.clone()
6702 }
6703}
6704impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6705 type Message = MavMessage;
6706 const ID: u32 = 437u32;
6707 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6708 const EXTRA_CRC: u8 = 30u8;
6709 const ENCODED_LEN: usize = 1usize;
6710 fn deser(
6711 _version: MavlinkVersion,
6712 __input: &[u8],
6713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6714 let avail_len = __input.len();
6715 let mut payload_buf = [0; Self::ENCODED_LEN];
6716 let mut buf = if avail_len < Self::ENCODED_LEN {
6717 payload_buf[0..avail_len].copy_from_slice(__input);
6718 Bytes::new(&payload_buf)
6719 } else {
6720 Bytes::new(__input)
6721 };
6722 let mut __struct = Self::default();
6723 __struct.seq = buf.get_u8()?;
6724 Ok(__struct)
6725 }
6726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6727 let mut __tmp = BytesMut::new(bytes);
6728 #[allow(clippy::absurd_extreme_comparisons)]
6729 #[allow(unused_comparisons)]
6730 if __tmp.remaining() < Self::ENCODED_LEN {
6731 panic!(
6732 "buffer is too small (need {} bytes, but got {})",
6733 Self::ENCODED_LEN,
6734 __tmp.remaining(),
6735 )
6736 }
6737 __tmp.put_u8(self.seq);
6738 if matches!(version, MavlinkVersion::V2) {
6739 let len = __tmp.len();
6740 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6741 } else {
6742 __tmp.len()
6743 }
6744 }
6745}
6746#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6747#[doc = ""]
6748#[doc = "ID: 372"]
6749#[derive(Debug, Clone, PartialEq)]
6750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6752#[cfg_attr(feature = "ts", derive(TS))]
6753#[cfg_attr(feature = "ts", ts(export))]
6754pub struct BATTERY_INFO_DATA {
6755 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6756 pub discharge_minimum_voltage: f32,
6757 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6758 pub charging_minimum_voltage: f32,
6759 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6760 pub resting_minimum_voltage: f32,
6761 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6762 pub charging_maximum_voltage: f32,
6763 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6764 pub charging_maximum_current: f32,
6765 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6766 pub nominal_voltage: f32,
6767 #[doc = "Maximum pack discharge current. 0: field not provided."]
6768 pub discharge_maximum_current: f32,
6769 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6770 pub discharge_maximum_burst_current: f32,
6771 #[doc = "Fully charged design capacity. 0: field not provided."]
6772 pub design_capacity: f32,
6773 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6774 pub full_charge_capacity: f32,
6775 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6776 pub cycle_count: u16,
6777 #[doc = "Battery weight. 0: field not provided."]
6778 pub weight: u16,
6779 #[doc = "Battery ID"]
6780 pub id: u8,
6781 #[doc = "Function of the battery."]
6782 pub battery_function: MavBatteryFunction,
6783 #[doc = "Type (chemistry) of the battery."]
6784 pub mavtype: MavBatteryType,
6785 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6786 pub state_of_health: u8,
6787 #[doc = "Number of battery cells in series. 0: field not provided."]
6788 pub cells_in_series: u8,
6789 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6790 #[cfg_attr(feature = "ts", ts(type = "string"))]
6791 pub manufacture_date: CharArray<9>,
6792 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6793 #[cfg_attr(feature = "ts", ts(type = "string"))]
6794 pub serial_number: CharArray<32>,
6795 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6796 #[cfg_attr(feature = "ts", ts(type = "string"))]
6797 pub name: CharArray<50>,
6798}
6799impl BATTERY_INFO_DATA {
6800 pub const ENCODED_LEN: usize = 140usize;
6801 pub const DEFAULT: Self = Self {
6802 discharge_minimum_voltage: 0.0_f32,
6803 charging_minimum_voltage: 0.0_f32,
6804 resting_minimum_voltage: 0.0_f32,
6805 charging_maximum_voltage: 0.0_f32,
6806 charging_maximum_current: 0.0_f32,
6807 nominal_voltage: 0.0_f32,
6808 discharge_maximum_current: 0.0_f32,
6809 discharge_maximum_burst_current: 0.0_f32,
6810 design_capacity: 0.0_f32,
6811 full_charge_capacity: 0.0_f32,
6812 cycle_count: 0_u16,
6813 weight: 0_u16,
6814 id: 0_u8,
6815 battery_function: MavBatteryFunction::DEFAULT,
6816 mavtype: MavBatteryType::DEFAULT,
6817 state_of_health: 0_u8,
6818 cells_in_series: 0_u8,
6819 manufacture_date: CharArray::new([0_u8; 9usize]),
6820 serial_number: CharArray::new([0_u8; 32usize]),
6821 name: CharArray::new([0_u8; 50usize]),
6822 };
6823 #[cfg(feature = "arbitrary")]
6824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6825 use arbitrary::{Arbitrary, Unstructured};
6826 let mut buf = [0u8; 1024];
6827 rng.fill_bytes(&mut buf);
6828 let mut unstructured = Unstructured::new(&buf);
6829 Self::arbitrary(&mut unstructured).unwrap_or_default()
6830 }
6831}
6832impl Default for BATTERY_INFO_DATA {
6833 fn default() -> Self {
6834 Self::DEFAULT.clone()
6835 }
6836}
6837impl MessageData for BATTERY_INFO_DATA {
6838 type Message = MavMessage;
6839 const ID: u32 = 372u32;
6840 const NAME: &'static str = "BATTERY_INFO";
6841 const EXTRA_CRC: u8 = 26u8;
6842 const ENCODED_LEN: usize = 140usize;
6843 fn deser(
6844 _version: MavlinkVersion,
6845 __input: &[u8],
6846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6847 let avail_len = __input.len();
6848 let mut payload_buf = [0; Self::ENCODED_LEN];
6849 let mut buf = if avail_len < Self::ENCODED_LEN {
6850 payload_buf[0..avail_len].copy_from_slice(__input);
6851 Bytes::new(&payload_buf)
6852 } else {
6853 Bytes::new(__input)
6854 };
6855 let mut __struct = Self::default();
6856 __struct.discharge_minimum_voltage = buf.get_f32_le()?;
6857 __struct.charging_minimum_voltage = buf.get_f32_le()?;
6858 __struct.resting_minimum_voltage = buf.get_f32_le()?;
6859 __struct.charging_maximum_voltage = buf.get_f32_le()?;
6860 __struct.charging_maximum_current = buf.get_f32_le()?;
6861 __struct.nominal_voltage = buf.get_f32_le()?;
6862 __struct.discharge_maximum_current = buf.get_f32_le()?;
6863 __struct.discharge_maximum_burst_current = buf.get_f32_le()?;
6864 __struct.design_capacity = buf.get_f32_le()?;
6865 __struct.full_charge_capacity = buf.get_f32_le()?;
6866 __struct.cycle_count = buf.get_u16_le()?;
6867 __struct.weight = buf.get_u16_le()?;
6868 __struct.id = buf.get_u8()?;
6869 let tmp = buf.get_u8()?;
6870 __struct.battery_function =
6871 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6872 enum_type: "MavBatteryFunction",
6873 value: tmp as u64,
6874 })?;
6875 let tmp = buf.get_u8()?;
6876 __struct.mavtype =
6877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6878 enum_type: "MavBatteryType",
6879 value: tmp as u64,
6880 })?;
6881 __struct.state_of_health = buf.get_u8()?;
6882 __struct.cells_in_series = buf.get_u8()?;
6883 let mut tmp = [0_u8; 9usize];
6884 for v in &mut tmp {
6885 *v = buf.get_u8()?;
6886 }
6887 __struct.manufacture_date = CharArray::new(tmp);
6888 let mut tmp = [0_u8; 32usize];
6889 for v in &mut tmp {
6890 *v = buf.get_u8()?;
6891 }
6892 __struct.serial_number = CharArray::new(tmp);
6893 let mut tmp = [0_u8; 50usize];
6894 for v in &mut tmp {
6895 *v = buf.get_u8()?;
6896 }
6897 __struct.name = CharArray::new(tmp);
6898 Ok(__struct)
6899 }
6900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6901 let mut __tmp = BytesMut::new(bytes);
6902 #[allow(clippy::absurd_extreme_comparisons)]
6903 #[allow(unused_comparisons)]
6904 if __tmp.remaining() < Self::ENCODED_LEN {
6905 panic!(
6906 "buffer is too small (need {} bytes, but got {})",
6907 Self::ENCODED_LEN,
6908 __tmp.remaining(),
6909 )
6910 }
6911 __tmp.put_f32_le(self.discharge_minimum_voltage);
6912 __tmp.put_f32_le(self.charging_minimum_voltage);
6913 __tmp.put_f32_le(self.resting_minimum_voltage);
6914 __tmp.put_f32_le(self.charging_maximum_voltage);
6915 __tmp.put_f32_le(self.charging_maximum_current);
6916 __tmp.put_f32_le(self.nominal_voltage);
6917 __tmp.put_f32_le(self.discharge_maximum_current);
6918 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6919 __tmp.put_f32_le(self.design_capacity);
6920 __tmp.put_f32_le(self.full_charge_capacity);
6921 __tmp.put_u16_le(self.cycle_count);
6922 __tmp.put_u16_le(self.weight);
6923 __tmp.put_u8(self.id);
6924 __tmp.put_u8(self.battery_function as u8);
6925 __tmp.put_u8(self.mavtype as u8);
6926 __tmp.put_u8(self.state_of_health);
6927 __tmp.put_u8(self.cells_in_series);
6928 for val in &self.manufacture_date {
6929 __tmp.put_u8(*val);
6930 }
6931 for val in &self.serial_number {
6932 __tmp.put_u8(*val);
6933 }
6934 for val in &self.name {
6935 __tmp.put_u8(*val);
6936 }
6937 if matches!(version, MavlinkVersion::V2) {
6938 let len = __tmp.len();
6939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6940 } else {
6941 __tmp.len()
6942 }
6943 }
6944}
6945#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6946#[doc = ""]
6947#[doc = "ID: 147"]
6948#[derive(Debug, Clone, PartialEq)]
6949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6951#[cfg_attr(feature = "ts", derive(TS))]
6952#[cfg_attr(feature = "ts", ts(export))]
6953pub struct BATTERY_STATUS_DATA {
6954 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6955 pub current_consumed: i32,
6956 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6957 pub energy_consumed: i32,
6958 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6959 pub temperature: i16,
6960 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6962 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6963 pub voltages: [u16; 10],
6964 #[doc = "Battery current, -1: autopilot does not measure the current"]
6965 pub current_battery: i16,
6966 #[doc = "Battery ID"]
6967 pub id: u8,
6968 #[doc = "Function of the battery"]
6969 pub battery_function: MavBatteryFunction,
6970 #[doc = "Type (chemistry) of the battery"]
6971 pub mavtype: MavBatteryType,
6972 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6973 pub battery_remaining: i8,
6974 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6976 pub time_remaining: i32,
6977 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6978 #[cfg_attr(feature = "serde", serde(default))]
6979 pub charge_state: MavBatteryChargeState,
6980 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6983 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6984 pub voltages_ext: [u16; 4],
6985 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6986 #[cfg_attr(feature = "serde", serde(default))]
6987 pub mode: MavBatteryMode,
6988 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6989 #[cfg_attr(feature = "serde", serde(default))]
6990 pub fault_bitmask: MavBatteryFault,
6991}
6992impl BATTERY_STATUS_DATA {
6993 pub const ENCODED_LEN: usize = 54usize;
6994 pub const DEFAULT: Self = Self {
6995 current_consumed: 0_i32,
6996 energy_consumed: 0_i32,
6997 temperature: 0_i16,
6998 voltages: [0_u16; 10usize],
6999 current_battery: 0_i16,
7000 id: 0_u8,
7001 battery_function: MavBatteryFunction::DEFAULT,
7002 mavtype: MavBatteryType::DEFAULT,
7003 battery_remaining: 0_i8,
7004 time_remaining: 0_i32,
7005 charge_state: MavBatteryChargeState::DEFAULT,
7006 voltages_ext: [0_u16; 4usize],
7007 mode: MavBatteryMode::DEFAULT,
7008 fault_bitmask: MavBatteryFault::DEFAULT,
7009 };
7010 #[cfg(feature = "arbitrary")]
7011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7012 use arbitrary::{Arbitrary, Unstructured};
7013 let mut buf = [0u8; 1024];
7014 rng.fill_bytes(&mut buf);
7015 let mut unstructured = Unstructured::new(&buf);
7016 Self::arbitrary(&mut unstructured).unwrap_or_default()
7017 }
7018}
7019impl Default for BATTERY_STATUS_DATA {
7020 fn default() -> Self {
7021 Self::DEFAULT.clone()
7022 }
7023}
7024impl MessageData for BATTERY_STATUS_DATA {
7025 type Message = MavMessage;
7026 const ID: u32 = 147u32;
7027 const NAME: &'static str = "BATTERY_STATUS";
7028 const EXTRA_CRC: u8 = 154u8;
7029 const ENCODED_LEN: usize = 54usize;
7030 fn deser(
7031 _version: MavlinkVersion,
7032 __input: &[u8],
7033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7034 let avail_len = __input.len();
7035 let mut payload_buf = [0; Self::ENCODED_LEN];
7036 let mut buf = if avail_len < Self::ENCODED_LEN {
7037 payload_buf[0..avail_len].copy_from_slice(__input);
7038 Bytes::new(&payload_buf)
7039 } else {
7040 Bytes::new(__input)
7041 };
7042 let mut __struct = Self::default();
7043 __struct.current_consumed = buf.get_i32_le()?;
7044 __struct.energy_consumed = buf.get_i32_le()?;
7045 __struct.temperature = buf.get_i16_le()?;
7046 for v in &mut __struct.voltages {
7047 let val = buf.get_u16_le()?;
7048 *v = val;
7049 }
7050 __struct.current_battery = buf.get_i16_le()?;
7051 __struct.id = buf.get_u8()?;
7052 let tmp = buf.get_u8()?;
7053 __struct.battery_function =
7054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7055 enum_type: "MavBatteryFunction",
7056 value: tmp as u64,
7057 })?;
7058 let tmp = buf.get_u8()?;
7059 __struct.mavtype =
7060 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7061 enum_type: "MavBatteryType",
7062 value: tmp as u64,
7063 })?;
7064 __struct.battery_remaining = buf.get_i8()?;
7065 __struct.time_remaining = buf.get_i32_le()?;
7066 let tmp = buf.get_u8()?;
7067 __struct.charge_state =
7068 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7069 enum_type: "MavBatteryChargeState",
7070 value: tmp as u64,
7071 })?;
7072 for v in &mut __struct.voltages_ext {
7073 let val = buf.get_u16_le()?;
7074 *v = val;
7075 }
7076 let tmp = buf.get_u8()?;
7077 __struct.mode =
7078 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7079 enum_type: "MavBatteryMode",
7080 value: tmp as u64,
7081 })?;
7082 let tmp = buf.get_u32_le()?;
7083 __struct.fault_bitmask = MavBatteryFault::from_bits(
7084 tmp as <MavBatteryFault as Flags>::Bits,
7085 )
7086 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7087 flag_type: "MavBatteryFault",
7088 value: tmp as u64,
7089 })?;
7090 Ok(__struct)
7091 }
7092 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7093 let mut __tmp = BytesMut::new(bytes);
7094 #[allow(clippy::absurd_extreme_comparisons)]
7095 #[allow(unused_comparisons)]
7096 if __tmp.remaining() < Self::ENCODED_LEN {
7097 panic!(
7098 "buffer is too small (need {} bytes, but got {})",
7099 Self::ENCODED_LEN,
7100 __tmp.remaining(),
7101 )
7102 }
7103 __tmp.put_i32_le(self.current_consumed);
7104 __tmp.put_i32_le(self.energy_consumed);
7105 __tmp.put_i16_le(self.temperature);
7106 for val in &self.voltages {
7107 __tmp.put_u16_le(*val);
7108 }
7109 __tmp.put_i16_le(self.current_battery);
7110 __tmp.put_u8(self.id);
7111 __tmp.put_u8(self.battery_function as u8);
7112 __tmp.put_u8(self.mavtype as u8);
7113 __tmp.put_i8(self.battery_remaining);
7114 if matches!(version, MavlinkVersion::V2) {
7115 __tmp.put_i32_le(self.time_remaining);
7116 __tmp.put_u8(self.charge_state as u8);
7117 for val in &self.voltages_ext {
7118 __tmp.put_u16_le(*val);
7119 }
7120 __tmp.put_u8(self.mode as u8);
7121 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
7122 let len = __tmp.len();
7123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7124 } else {
7125 __tmp.len()
7126 }
7127 }
7128}
7129#[doc = "Battery dynamic information. This should be streamed (nominally at 1Hz). Static/invariant battery information is sent in BATTERY_INFO. Note that smart batteries should set the MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL bit to indicate that supplied capacity values are relative to a battery that is known to be full. Power monitors would not set this bit, indicating that capacity_consumed is relative to drone power-on, and that other values are estimated based on the assumption that the battery was full on power-on."]
7130#[doc = ""]
7131#[doc = "ID: 369"]
7132#[derive(Debug, Clone, PartialEq)]
7133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7135#[cfg_attr(feature = "ts", derive(TS))]
7136#[cfg_attr(feature = "ts", ts(export))]
7137pub struct BATTERY_STATUS_V2_DATA {
7138 #[doc = "Battery voltage (total). NaN: field not provided."]
7139 pub voltage: f32,
7140 #[doc = "Battery current (through all cells/loads). Positive value when discharging and negative if charging. NaN: field not provided."]
7141 pub current: f32,
7142 #[doc = "Consumed charge. NaN: field not provided. This is either the consumption since power-on or since the battery was full, depending on the value of MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL."]
7143 pub capacity_consumed: f32,
7144 #[doc = "Remaining charge (until empty). NaN: field not provided. Note: If MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL is unset, this value is based on the assumption the battery was full when the system was powered."]
7145 pub capacity_remaining: f32,
7146 #[doc = "Fault, health, readiness, and other status indications."]
7147 pub status_flags: MavBatteryStatusFlags,
7148 #[doc = "Temperature of the whole battery pack (not internal electronics). INT16_MAX field not provided."]
7149 pub temperature: i16,
7150 #[doc = "Battery ID"]
7151 pub id: u8,
7152 #[doc = "Remaining battery energy. Values: [0-100], UINT8_MAX: field not provided."]
7153 pub percent_remaining: u8,
7154}
7155impl BATTERY_STATUS_V2_DATA {
7156 pub const ENCODED_LEN: usize = 24usize;
7157 pub const DEFAULT: Self = Self {
7158 voltage: 0.0_f32,
7159 current: 0.0_f32,
7160 capacity_consumed: 0.0_f32,
7161 capacity_remaining: 0.0_f32,
7162 status_flags: MavBatteryStatusFlags::DEFAULT,
7163 temperature: 0_i16,
7164 id: 0_u8,
7165 percent_remaining: 0_u8,
7166 };
7167 #[cfg(feature = "arbitrary")]
7168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7169 use arbitrary::{Arbitrary, Unstructured};
7170 let mut buf = [0u8; 1024];
7171 rng.fill_bytes(&mut buf);
7172 let mut unstructured = Unstructured::new(&buf);
7173 Self::arbitrary(&mut unstructured).unwrap_or_default()
7174 }
7175}
7176impl Default for BATTERY_STATUS_V2_DATA {
7177 fn default() -> Self {
7178 Self::DEFAULT.clone()
7179 }
7180}
7181impl MessageData for BATTERY_STATUS_V2_DATA {
7182 type Message = MavMessage;
7183 const ID: u32 = 369u32;
7184 const NAME: &'static str = "BATTERY_STATUS_V2";
7185 const EXTRA_CRC: u8 = 151u8;
7186 const ENCODED_LEN: usize = 24usize;
7187 fn deser(
7188 _version: MavlinkVersion,
7189 __input: &[u8],
7190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7191 let avail_len = __input.len();
7192 let mut payload_buf = [0; Self::ENCODED_LEN];
7193 let mut buf = if avail_len < Self::ENCODED_LEN {
7194 payload_buf[0..avail_len].copy_from_slice(__input);
7195 Bytes::new(&payload_buf)
7196 } else {
7197 Bytes::new(__input)
7198 };
7199 let mut __struct = Self::default();
7200 __struct.voltage = buf.get_f32_le()?;
7201 __struct.current = buf.get_f32_le()?;
7202 __struct.capacity_consumed = buf.get_f32_le()?;
7203 __struct.capacity_remaining = buf.get_f32_le()?;
7204 let tmp = buf.get_u32_le()?;
7205 __struct.status_flags = MavBatteryStatusFlags::from_bits(
7206 tmp as <MavBatteryStatusFlags as Flags>::Bits,
7207 )
7208 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7209 flag_type: "MavBatteryStatusFlags",
7210 value: tmp as u64,
7211 })?;
7212 __struct.temperature = buf.get_i16_le()?;
7213 __struct.id = buf.get_u8()?;
7214 __struct.percent_remaining = buf.get_u8()?;
7215 Ok(__struct)
7216 }
7217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7218 let mut __tmp = BytesMut::new(bytes);
7219 #[allow(clippy::absurd_extreme_comparisons)]
7220 #[allow(unused_comparisons)]
7221 if __tmp.remaining() < Self::ENCODED_LEN {
7222 panic!(
7223 "buffer is too small (need {} bytes, but got {})",
7224 Self::ENCODED_LEN,
7225 __tmp.remaining(),
7226 )
7227 }
7228 __tmp.put_f32_le(self.voltage);
7229 __tmp.put_f32_le(self.current);
7230 __tmp.put_f32_le(self.capacity_consumed);
7231 __tmp.put_f32_le(self.capacity_remaining);
7232 __tmp.put_u32_le(self.status_flags.bits() as u32);
7233 __tmp.put_i16_le(self.temperature);
7234 __tmp.put_u8(self.id);
7235 __tmp.put_u8(self.percent_remaining);
7236 if matches!(version, MavlinkVersion::V2) {
7237 let len = __tmp.len();
7238 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7239 } else {
7240 __tmp.len()
7241 }
7242 }
7243}
7244#[doc = "Report button state change."]
7245#[doc = ""]
7246#[doc = "ID: 257"]
7247#[derive(Debug, Clone, PartialEq)]
7248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7250#[cfg_attr(feature = "ts", derive(TS))]
7251#[cfg_attr(feature = "ts", ts(export))]
7252pub struct BUTTON_CHANGE_DATA {
7253 #[doc = "Timestamp (time since system boot)."]
7254 pub time_boot_ms: u32,
7255 #[doc = "Time of last change of button state."]
7256 pub last_change_ms: u32,
7257 #[doc = "Bitmap for state of buttons."]
7258 pub state: u8,
7259}
7260impl BUTTON_CHANGE_DATA {
7261 pub const ENCODED_LEN: usize = 9usize;
7262 pub const DEFAULT: Self = Self {
7263 time_boot_ms: 0_u32,
7264 last_change_ms: 0_u32,
7265 state: 0_u8,
7266 };
7267 #[cfg(feature = "arbitrary")]
7268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7269 use arbitrary::{Arbitrary, Unstructured};
7270 let mut buf = [0u8; 1024];
7271 rng.fill_bytes(&mut buf);
7272 let mut unstructured = Unstructured::new(&buf);
7273 Self::arbitrary(&mut unstructured).unwrap_or_default()
7274 }
7275}
7276impl Default for BUTTON_CHANGE_DATA {
7277 fn default() -> Self {
7278 Self::DEFAULT.clone()
7279 }
7280}
7281impl MessageData for BUTTON_CHANGE_DATA {
7282 type Message = MavMessage;
7283 const ID: u32 = 257u32;
7284 const NAME: &'static str = "BUTTON_CHANGE";
7285 const EXTRA_CRC: u8 = 131u8;
7286 const ENCODED_LEN: usize = 9usize;
7287 fn deser(
7288 _version: MavlinkVersion,
7289 __input: &[u8],
7290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7291 let avail_len = __input.len();
7292 let mut payload_buf = [0; Self::ENCODED_LEN];
7293 let mut buf = if avail_len < Self::ENCODED_LEN {
7294 payload_buf[0..avail_len].copy_from_slice(__input);
7295 Bytes::new(&payload_buf)
7296 } else {
7297 Bytes::new(__input)
7298 };
7299 let mut __struct = Self::default();
7300 __struct.time_boot_ms = buf.get_u32_le()?;
7301 __struct.last_change_ms = buf.get_u32_le()?;
7302 __struct.state = buf.get_u8()?;
7303 Ok(__struct)
7304 }
7305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7306 let mut __tmp = BytesMut::new(bytes);
7307 #[allow(clippy::absurd_extreme_comparisons)]
7308 #[allow(unused_comparisons)]
7309 if __tmp.remaining() < Self::ENCODED_LEN {
7310 panic!(
7311 "buffer is too small (need {} bytes, but got {})",
7312 Self::ENCODED_LEN,
7313 __tmp.remaining(),
7314 )
7315 }
7316 __tmp.put_u32_le(self.time_boot_ms);
7317 __tmp.put_u32_le(self.last_change_ms);
7318 __tmp.put_u8(self.state);
7319 if matches!(version, MavlinkVersion::V2) {
7320 let len = __tmp.len();
7321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7322 } else {
7323 __tmp.len()
7324 }
7325 }
7326}
7327#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7328#[doc = ""]
7329#[doc = "ID: 262"]
7330#[derive(Debug, Clone, PartialEq)]
7331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7333#[cfg_attr(feature = "ts", derive(TS))]
7334#[cfg_attr(feature = "ts", ts(export))]
7335pub struct CAMERA_CAPTURE_STATUS_DATA {
7336 #[doc = "Timestamp (time since system boot)."]
7337 pub time_boot_ms: u32,
7338 #[doc = "Image capture interval"]
7339 pub image_interval: f32,
7340 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7341 pub recording_time_ms: u32,
7342 #[doc = "Available storage capacity."]
7343 pub available_capacity: f32,
7344 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7345 pub image_status: u8,
7346 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7347 pub video_status: u8,
7348 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7349 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7350 pub image_count: i32,
7351 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7352 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7353 pub camera_device_id: u8,
7354}
7355impl CAMERA_CAPTURE_STATUS_DATA {
7356 pub const ENCODED_LEN: usize = 23usize;
7357 pub const DEFAULT: Self = Self {
7358 time_boot_ms: 0_u32,
7359 image_interval: 0.0_f32,
7360 recording_time_ms: 0_u32,
7361 available_capacity: 0.0_f32,
7362 image_status: 0_u8,
7363 video_status: 0_u8,
7364 image_count: 0_i32,
7365 camera_device_id: 0_u8,
7366 };
7367 #[cfg(feature = "arbitrary")]
7368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7369 use arbitrary::{Arbitrary, Unstructured};
7370 let mut buf = [0u8; 1024];
7371 rng.fill_bytes(&mut buf);
7372 let mut unstructured = Unstructured::new(&buf);
7373 Self::arbitrary(&mut unstructured).unwrap_or_default()
7374 }
7375}
7376impl Default for CAMERA_CAPTURE_STATUS_DATA {
7377 fn default() -> Self {
7378 Self::DEFAULT.clone()
7379 }
7380}
7381impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7382 type Message = MavMessage;
7383 const ID: u32 = 262u32;
7384 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7385 const EXTRA_CRC: u8 = 12u8;
7386 const ENCODED_LEN: usize = 23usize;
7387 fn deser(
7388 _version: MavlinkVersion,
7389 __input: &[u8],
7390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7391 let avail_len = __input.len();
7392 let mut payload_buf = [0; Self::ENCODED_LEN];
7393 let mut buf = if avail_len < Self::ENCODED_LEN {
7394 payload_buf[0..avail_len].copy_from_slice(__input);
7395 Bytes::new(&payload_buf)
7396 } else {
7397 Bytes::new(__input)
7398 };
7399 let mut __struct = Self::default();
7400 __struct.time_boot_ms = buf.get_u32_le()?;
7401 __struct.image_interval = buf.get_f32_le()?;
7402 __struct.recording_time_ms = buf.get_u32_le()?;
7403 __struct.available_capacity = buf.get_f32_le()?;
7404 __struct.image_status = buf.get_u8()?;
7405 __struct.video_status = buf.get_u8()?;
7406 __struct.image_count = buf.get_i32_le()?;
7407 __struct.camera_device_id = buf.get_u8()?;
7408 Ok(__struct)
7409 }
7410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7411 let mut __tmp = BytesMut::new(bytes);
7412 #[allow(clippy::absurd_extreme_comparisons)]
7413 #[allow(unused_comparisons)]
7414 if __tmp.remaining() < Self::ENCODED_LEN {
7415 panic!(
7416 "buffer is too small (need {} bytes, but got {})",
7417 Self::ENCODED_LEN,
7418 __tmp.remaining(),
7419 )
7420 }
7421 __tmp.put_u32_le(self.time_boot_ms);
7422 __tmp.put_f32_le(self.image_interval);
7423 __tmp.put_u32_le(self.recording_time_ms);
7424 __tmp.put_f32_le(self.available_capacity);
7425 __tmp.put_u8(self.image_status);
7426 __tmp.put_u8(self.video_status);
7427 if matches!(version, MavlinkVersion::V2) {
7428 __tmp.put_i32_le(self.image_count);
7429 __tmp.put_u8(self.camera_device_id);
7430 let len = __tmp.len();
7431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7432 } else {
7433 __tmp.len()
7434 }
7435 }
7436}
7437#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7438#[doc = ""]
7439#[doc = "ID: 271"]
7440#[derive(Debug, Clone, PartialEq)]
7441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7443#[cfg_attr(feature = "ts", derive(TS))]
7444#[cfg_attr(feature = "ts", ts(export))]
7445pub struct CAMERA_FOV_STATUS_DATA {
7446 #[doc = "Timestamp (time since system boot)."]
7447 pub time_boot_ms: u32,
7448 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7449 pub lat_camera: i32,
7450 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7451 pub lon_camera: i32,
7452 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7453 pub alt_camera: i32,
7454 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7455 pub lat_image: i32,
7456 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7457 pub lon_image: i32,
7458 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7459 pub alt_image: i32,
7460 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7461 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7462 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7463 pub q: [f32; 4],
7464 #[doc = "Horizontal field of view (NaN if unknown)."]
7465 pub hfov: f32,
7466 #[doc = "Vertical field of view (NaN if unknown)."]
7467 pub vfov: f32,
7468 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7469 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7470 pub camera_device_id: u8,
7471}
7472impl CAMERA_FOV_STATUS_DATA {
7473 pub const ENCODED_LEN: usize = 53usize;
7474 pub const DEFAULT: Self = Self {
7475 time_boot_ms: 0_u32,
7476 lat_camera: 0_i32,
7477 lon_camera: 0_i32,
7478 alt_camera: 0_i32,
7479 lat_image: 0_i32,
7480 lon_image: 0_i32,
7481 alt_image: 0_i32,
7482 q: [0.0_f32; 4usize],
7483 hfov: 0.0_f32,
7484 vfov: 0.0_f32,
7485 camera_device_id: 0_u8,
7486 };
7487 #[cfg(feature = "arbitrary")]
7488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7489 use arbitrary::{Arbitrary, Unstructured};
7490 let mut buf = [0u8; 1024];
7491 rng.fill_bytes(&mut buf);
7492 let mut unstructured = Unstructured::new(&buf);
7493 Self::arbitrary(&mut unstructured).unwrap_or_default()
7494 }
7495}
7496impl Default for CAMERA_FOV_STATUS_DATA {
7497 fn default() -> Self {
7498 Self::DEFAULT.clone()
7499 }
7500}
7501impl MessageData for CAMERA_FOV_STATUS_DATA {
7502 type Message = MavMessage;
7503 const ID: u32 = 271u32;
7504 const NAME: &'static str = "CAMERA_FOV_STATUS";
7505 const EXTRA_CRC: u8 = 22u8;
7506 const ENCODED_LEN: usize = 53usize;
7507 fn deser(
7508 _version: MavlinkVersion,
7509 __input: &[u8],
7510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7511 let avail_len = __input.len();
7512 let mut payload_buf = [0; Self::ENCODED_LEN];
7513 let mut buf = if avail_len < Self::ENCODED_LEN {
7514 payload_buf[0..avail_len].copy_from_slice(__input);
7515 Bytes::new(&payload_buf)
7516 } else {
7517 Bytes::new(__input)
7518 };
7519 let mut __struct = Self::default();
7520 __struct.time_boot_ms = buf.get_u32_le()?;
7521 __struct.lat_camera = buf.get_i32_le()?;
7522 __struct.lon_camera = buf.get_i32_le()?;
7523 __struct.alt_camera = buf.get_i32_le()?;
7524 __struct.lat_image = buf.get_i32_le()?;
7525 __struct.lon_image = buf.get_i32_le()?;
7526 __struct.alt_image = buf.get_i32_le()?;
7527 for v in &mut __struct.q {
7528 let val = buf.get_f32_le()?;
7529 *v = val;
7530 }
7531 __struct.hfov = buf.get_f32_le()?;
7532 __struct.vfov = buf.get_f32_le()?;
7533 __struct.camera_device_id = buf.get_u8()?;
7534 Ok(__struct)
7535 }
7536 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7537 let mut __tmp = BytesMut::new(bytes);
7538 #[allow(clippy::absurd_extreme_comparisons)]
7539 #[allow(unused_comparisons)]
7540 if __tmp.remaining() < Self::ENCODED_LEN {
7541 panic!(
7542 "buffer is too small (need {} bytes, but got {})",
7543 Self::ENCODED_LEN,
7544 __tmp.remaining(),
7545 )
7546 }
7547 __tmp.put_u32_le(self.time_boot_ms);
7548 __tmp.put_i32_le(self.lat_camera);
7549 __tmp.put_i32_le(self.lon_camera);
7550 __tmp.put_i32_le(self.alt_camera);
7551 __tmp.put_i32_le(self.lat_image);
7552 __tmp.put_i32_le(self.lon_image);
7553 __tmp.put_i32_le(self.alt_image);
7554 for val in &self.q {
7555 __tmp.put_f32_le(*val);
7556 }
7557 __tmp.put_f32_le(self.hfov);
7558 __tmp.put_f32_le(self.vfov);
7559 if matches!(version, MavlinkVersion::V2) {
7560 __tmp.put_u8(self.camera_device_id);
7561 let len = __tmp.len();
7562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7563 } else {
7564 __tmp.len()
7565 }
7566 }
7567}
7568#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7569#[doc = ""]
7570#[doc = "ID: 263"]
7571#[derive(Debug, Clone, PartialEq)]
7572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7574#[cfg_attr(feature = "ts", derive(TS))]
7575#[cfg_attr(feature = "ts", ts(export))]
7576pub struct CAMERA_IMAGE_CAPTURED_DATA {
7577 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7578 pub time_utc: u64,
7579 #[doc = "Timestamp (time since system boot)."]
7580 pub time_boot_ms: u32,
7581 #[doc = "Latitude where image was taken"]
7582 pub lat: i32,
7583 #[doc = "Longitude where capture was taken"]
7584 pub lon: i32,
7585 #[doc = "Altitude (MSL) where image was taken"]
7586 pub alt: i32,
7587 #[doc = "Altitude above ground"]
7588 pub relative_alt: i32,
7589 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7590 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7591 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7592 pub q: [f32; 4],
7593 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7594 pub image_index: i32,
7595 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7596 pub camera_id: u8,
7597 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7598 pub capture_result: i8,
7599 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7600 #[cfg_attr(feature = "ts", ts(type = "string"))]
7601 pub file_url: CharArray<205>,
7602}
7603impl CAMERA_IMAGE_CAPTURED_DATA {
7604 pub const ENCODED_LEN: usize = 255usize;
7605 pub const DEFAULT: Self = Self {
7606 time_utc: 0_u64,
7607 time_boot_ms: 0_u32,
7608 lat: 0_i32,
7609 lon: 0_i32,
7610 alt: 0_i32,
7611 relative_alt: 0_i32,
7612 q: [0.0_f32; 4usize],
7613 image_index: 0_i32,
7614 camera_id: 0_u8,
7615 capture_result: 0_i8,
7616 file_url: CharArray::new([0_u8; 205usize]),
7617 };
7618 #[cfg(feature = "arbitrary")]
7619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7620 use arbitrary::{Arbitrary, Unstructured};
7621 let mut buf = [0u8; 1024];
7622 rng.fill_bytes(&mut buf);
7623 let mut unstructured = Unstructured::new(&buf);
7624 Self::arbitrary(&mut unstructured).unwrap_or_default()
7625 }
7626}
7627impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7628 fn default() -> Self {
7629 Self::DEFAULT.clone()
7630 }
7631}
7632impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7633 type Message = MavMessage;
7634 const ID: u32 = 263u32;
7635 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7636 const EXTRA_CRC: u8 = 133u8;
7637 const ENCODED_LEN: usize = 255usize;
7638 fn deser(
7639 _version: MavlinkVersion,
7640 __input: &[u8],
7641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7642 let avail_len = __input.len();
7643 let mut payload_buf = [0; Self::ENCODED_LEN];
7644 let mut buf = if avail_len < Self::ENCODED_LEN {
7645 payload_buf[0..avail_len].copy_from_slice(__input);
7646 Bytes::new(&payload_buf)
7647 } else {
7648 Bytes::new(__input)
7649 };
7650 let mut __struct = Self::default();
7651 __struct.time_utc = buf.get_u64_le()?;
7652 __struct.time_boot_ms = buf.get_u32_le()?;
7653 __struct.lat = buf.get_i32_le()?;
7654 __struct.lon = buf.get_i32_le()?;
7655 __struct.alt = buf.get_i32_le()?;
7656 __struct.relative_alt = buf.get_i32_le()?;
7657 for v in &mut __struct.q {
7658 let val = buf.get_f32_le()?;
7659 *v = val;
7660 }
7661 __struct.image_index = buf.get_i32_le()?;
7662 __struct.camera_id = buf.get_u8()?;
7663 __struct.capture_result = buf.get_i8()?;
7664 let mut tmp = [0_u8; 205usize];
7665 for v in &mut tmp {
7666 *v = buf.get_u8()?;
7667 }
7668 __struct.file_url = CharArray::new(tmp);
7669 Ok(__struct)
7670 }
7671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7672 let mut __tmp = BytesMut::new(bytes);
7673 #[allow(clippy::absurd_extreme_comparisons)]
7674 #[allow(unused_comparisons)]
7675 if __tmp.remaining() < Self::ENCODED_LEN {
7676 panic!(
7677 "buffer is too small (need {} bytes, but got {})",
7678 Self::ENCODED_LEN,
7679 __tmp.remaining(),
7680 )
7681 }
7682 __tmp.put_u64_le(self.time_utc);
7683 __tmp.put_u32_le(self.time_boot_ms);
7684 __tmp.put_i32_le(self.lat);
7685 __tmp.put_i32_le(self.lon);
7686 __tmp.put_i32_le(self.alt);
7687 __tmp.put_i32_le(self.relative_alt);
7688 for val in &self.q {
7689 __tmp.put_f32_le(*val);
7690 }
7691 __tmp.put_i32_le(self.image_index);
7692 __tmp.put_u8(self.camera_id);
7693 __tmp.put_i8(self.capture_result);
7694 for val in &self.file_url {
7695 __tmp.put_u8(*val);
7696 }
7697 if matches!(version, MavlinkVersion::V2) {
7698 let len = __tmp.len();
7699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7700 } else {
7701 __tmp.len()
7702 }
7703 }
7704}
7705#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7706#[doc = ""]
7707#[doc = "ID: 259"]
7708#[derive(Debug, Clone, PartialEq)]
7709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7711#[cfg_attr(feature = "ts", derive(TS))]
7712#[cfg_attr(feature = "ts", ts(export))]
7713pub struct CAMERA_INFORMATION_DATA {
7714 #[doc = "Timestamp (time since system boot)."]
7715 pub time_boot_ms: u32,
7716 #[doc = "0xff). Use 0 if not known."]
7717 pub firmware_version: u32,
7718 #[doc = "Focal length. Use NaN if not known."]
7719 pub focal_length: f32,
7720 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7721 pub sensor_size_h: f32,
7722 #[doc = "Image sensor size vertical. Use NaN if not known."]
7723 pub sensor_size_v: f32,
7724 #[doc = "Bitmap of camera capability flags."]
7725 pub flags: CameraCapFlags,
7726 #[doc = "Horizontal image resolution. Use 0 if not known."]
7727 pub resolution_h: u16,
7728 #[doc = "Vertical image resolution. Use 0 if not known."]
7729 pub resolution_v: u16,
7730 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7731 pub cam_definition_version: u16,
7732 #[doc = "Name of the camera vendor"]
7733 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7734 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7735 pub vendor_name: [u8; 32],
7736 #[doc = "Name of the camera model"]
7737 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7738 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7739 pub model_name: [u8; 32],
7740 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7741 pub lens_id: u8,
7742 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7743 #[cfg_attr(feature = "ts", ts(type = "string"))]
7744 pub cam_definition_uri: CharArray<140>,
7745 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7746 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7747 pub gimbal_device_id: u8,
7748 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7749 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7750 pub camera_device_id: u8,
7751}
7752impl CAMERA_INFORMATION_DATA {
7753 pub const ENCODED_LEN: usize = 237usize;
7754 pub const DEFAULT: Self = Self {
7755 time_boot_ms: 0_u32,
7756 firmware_version: 0_u32,
7757 focal_length: 0.0_f32,
7758 sensor_size_h: 0.0_f32,
7759 sensor_size_v: 0.0_f32,
7760 flags: CameraCapFlags::DEFAULT,
7761 resolution_h: 0_u16,
7762 resolution_v: 0_u16,
7763 cam_definition_version: 0_u16,
7764 vendor_name: [0_u8; 32usize],
7765 model_name: [0_u8; 32usize],
7766 lens_id: 0_u8,
7767 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7768 gimbal_device_id: 0_u8,
7769 camera_device_id: 0_u8,
7770 };
7771 #[cfg(feature = "arbitrary")]
7772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7773 use arbitrary::{Arbitrary, Unstructured};
7774 let mut buf = [0u8; 1024];
7775 rng.fill_bytes(&mut buf);
7776 let mut unstructured = Unstructured::new(&buf);
7777 Self::arbitrary(&mut unstructured).unwrap_or_default()
7778 }
7779}
7780impl Default for CAMERA_INFORMATION_DATA {
7781 fn default() -> Self {
7782 Self::DEFAULT.clone()
7783 }
7784}
7785impl MessageData for CAMERA_INFORMATION_DATA {
7786 type Message = MavMessage;
7787 const ID: u32 = 259u32;
7788 const NAME: &'static str = "CAMERA_INFORMATION";
7789 const EXTRA_CRC: u8 = 92u8;
7790 const ENCODED_LEN: usize = 237usize;
7791 fn deser(
7792 _version: MavlinkVersion,
7793 __input: &[u8],
7794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7795 let avail_len = __input.len();
7796 let mut payload_buf = [0; Self::ENCODED_LEN];
7797 let mut buf = if avail_len < Self::ENCODED_LEN {
7798 payload_buf[0..avail_len].copy_from_slice(__input);
7799 Bytes::new(&payload_buf)
7800 } else {
7801 Bytes::new(__input)
7802 };
7803 let mut __struct = Self::default();
7804 __struct.time_boot_ms = buf.get_u32_le()?;
7805 __struct.firmware_version = buf.get_u32_le()?;
7806 __struct.focal_length = buf.get_f32_le()?;
7807 __struct.sensor_size_h = buf.get_f32_le()?;
7808 __struct.sensor_size_v = buf.get_f32_le()?;
7809 let tmp = buf.get_u32_le()?;
7810 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7811 ::mavlink_core::error::ParserError::InvalidFlag {
7812 flag_type: "CameraCapFlags",
7813 value: tmp as u64,
7814 },
7815 )?;
7816 __struct.resolution_h = buf.get_u16_le()?;
7817 __struct.resolution_v = buf.get_u16_le()?;
7818 __struct.cam_definition_version = buf.get_u16_le()?;
7819 for v in &mut __struct.vendor_name {
7820 let val = buf.get_u8()?;
7821 *v = val;
7822 }
7823 for v in &mut __struct.model_name {
7824 let val = buf.get_u8()?;
7825 *v = val;
7826 }
7827 __struct.lens_id = buf.get_u8()?;
7828 let mut tmp = [0_u8; 140usize];
7829 for v in &mut tmp {
7830 *v = buf.get_u8()?;
7831 }
7832 __struct.cam_definition_uri = CharArray::new(tmp);
7833 __struct.gimbal_device_id = buf.get_u8()?;
7834 __struct.camera_device_id = buf.get_u8()?;
7835 Ok(__struct)
7836 }
7837 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7838 let mut __tmp = BytesMut::new(bytes);
7839 #[allow(clippy::absurd_extreme_comparisons)]
7840 #[allow(unused_comparisons)]
7841 if __tmp.remaining() < Self::ENCODED_LEN {
7842 panic!(
7843 "buffer is too small (need {} bytes, but got {})",
7844 Self::ENCODED_LEN,
7845 __tmp.remaining(),
7846 )
7847 }
7848 __tmp.put_u32_le(self.time_boot_ms);
7849 __tmp.put_u32_le(self.firmware_version);
7850 __tmp.put_f32_le(self.focal_length);
7851 __tmp.put_f32_le(self.sensor_size_h);
7852 __tmp.put_f32_le(self.sensor_size_v);
7853 __tmp.put_u32_le(self.flags.bits() as u32);
7854 __tmp.put_u16_le(self.resolution_h);
7855 __tmp.put_u16_le(self.resolution_v);
7856 __tmp.put_u16_le(self.cam_definition_version);
7857 for val in &self.vendor_name {
7858 __tmp.put_u8(*val);
7859 }
7860 for val in &self.model_name {
7861 __tmp.put_u8(*val);
7862 }
7863 __tmp.put_u8(self.lens_id);
7864 for val in &self.cam_definition_uri {
7865 __tmp.put_u8(*val);
7866 }
7867 if matches!(version, MavlinkVersion::V2) {
7868 __tmp.put_u8(self.gimbal_device_id);
7869 __tmp.put_u8(self.camera_device_id);
7870 let len = __tmp.len();
7871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7872 } else {
7873 __tmp.len()
7874 }
7875 }
7876}
7877#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7878#[doc = ""]
7879#[doc = "ID: 260"]
7880#[derive(Debug, Clone, PartialEq)]
7881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7883#[cfg_attr(feature = "ts", derive(TS))]
7884#[cfg_attr(feature = "ts", ts(export))]
7885pub struct CAMERA_SETTINGS_DATA {
7886 #[doc = "Timestamp (time since system boot)."]
7887 pub time_boot_ms: u32,
7888 #[doc = "Camera mode"]
7889 pub mode_id: CameraMode,
7890 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7892 pub zoomLevel: f32,
7893 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7895 pub focusLevel: f32,
7896 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7897 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7898 pub camera_device_id: u8,
7899}
7900impl CAMERA_SETTINGS_DATA {
7901 pub const ENCODED_LEN: usize = 14usize;
7902 pub const DEFAULT: Self = Self {
7903 time_boot_ms: 0_u32,
7904 mode_id: CameraMode::DEFAULT,
7905 zoomLevel: 0.0_f32,
7906 focusLevel: 0.0_f32,
7907 camera_device_id: 0_u8,
7908 };
7909 #[cfg(feature = "arbitrary")]
7910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7911 use arbitrary::{Arbitrary, Unstructured};
7912 let mut buf = [0u8; 1024];
7913 rng.fill_bytes(&mut buf);
7914 let mut unstructured = Unstructured::new(&buf);
7915 Self::arbitrary(&mut unstructured).unwrap_or_default()
7916 }
7917}
7918impl Default for CAMERA_SETTINGS_DATA {
7919 fn default() -> Self {
7920 Self::DEFAULT.clone()
7921 }
7922}
7923impl MessageData for CAMERA_SETTINGS_DATA {
7924 type Message = MavMessage;
7925 const ID: u32 = 260u32;
7926 const NAME: &'static str = "CAMERA_SETTINGS";
7927 const EXTRA_CRC: u8 = 146u8;
7928 const ENCODED_LEN: usize = 14usize;
7929 fn deser(
7930 _version: MavlinkVersion,
7931 __input: &[u8],
7932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7933 let avail_len = __input.len();
7934 let mut payload_buf = [0; Self::ENCODED_LEN];
7935 let mut buf = if avail_len < Self::ENCODED_LEN {
7936 payload_buf[0..avail_len].copy_from_slice(__input);
7937 Bytes::new(&payload_buf)
7938 } else {
7939 Bytes::new(__input)
7940 };
7941 let mut __struct = Self::default();
7942 __struct.time_boot_ms = buf.get_u32_le()?;
7943 let tmp = buf.get_u8()?;
7944 __struct.mode_id =
7945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7946 enum_type: "CameraMode",
7947 value: tmp as u64,
7948 })?;
7949 __struct.zoomLevel = buf.get_f32_le()?;
7950 __struct.focusLevel = buf.get_f32_le()?;
7951 __struct.camera_device_id = buf.get_u8()?;
7952 Ok(__struct)
7953 }
7954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7955 let mut __tmp = BytesMut::new(bytes);
7956 #[allow(clippy::absurd_extreme_comparisons)]
7957 #[allow(unused_comparisons)]
7958 if __tmp.remaining() < Self::ENCODED_LEN {
7959 panic!(
7960 "buffer is too small (need {} bytes, but got {})",
7961 Self::ENCODED_LEN,
7962 __tmp.remaining(),
7963 )
7964 }
7965 __tmp.put_u32_le(self.time_boot_ms);
7966 __tmp.put_u8(self.mode_id as u8);
7967 if matches!(version, MavlinkVersion::V2) {
7968 __tmp.put_f32_le(self.zoomLevel);
7969 __tmp.put_f32_le(self.focusLevel);
7970 __tmp.put_u8(self.camera_device_id);
7971 let len = __tmp.len();
7972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7973 } else {
7974 __tmp.len()
7975 }
7976 }
7977}
7978#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7979#[doc = ""]
7980#[doc = "ID: 277"]
7981#[derive(Debug, Clone, PartialEq)]
7982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7984#[cfg_attr(feature = "ts", derive(TS))]
7985#[cfg_attr(feature = "ts", ts(export))]
7986pub struct CAMERA_THERMAL_RANGE_DATA {
7987 #[doc = "Timestamp (time since system boot)."]
7988 pub time_boot_ms: u32,
7989 #[doc = "Temperature max."]
7990 pub max: f32,
7991 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7992 pub max_point_x: f32,
7993 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7994 pub max_point_y: f32,
7995 #[doc = "Temperature min."]
7996 pub min: f32,
7997 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7998 pub min_point_x: f32,
7999 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8000 pub min_point_y: f32,
8001 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
8002 pub stream_id: u8,
8003 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8004 pub camera_device_id: u8,
8005}
8006impl CAMERA_THERMAL_RANGE_DATA {
8007 pub const ENCODED_LEN: usize = 30usize;
8008 pub const DEFAULT: Self = Self {
8009 time_boot_ms: 0_u32,
8010 max: 0.0_f32,
8011 max_point_x: 0.0_f32,
8012 max_point_y: 0.0_f32,
8013 min: 0.0_f32,
8014 min_point_x: 0.0_f32,
8015 min_point_y: 0.0_f32,
8016 stream_id: 0_u8,
8017 camera_device_id: 0_u8,
8018 };
8019 #[cfg(feature = "arbitrary")]
8020 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8021 use arbitrary::{Arbitrary, Unstructured};
8022 let mut buf = [0u8; 1024];
8023 rng.fill_bytes(&mut buf);
8024 let mut unstructured = Unstructured::new(&buf);
8025 Self::arbitrary(&mut unstructured).unwrap_or_default()
8026 }
8027}
8028impl Default for CAMERA_THERMAL_RANGE_DATA {
8029 fn default() -> Self {
8030 Self::DEFAULT.clone()
8031 }
8032}
8033impl MessageData for CAMERA_THERMAL_RANGE_DATA {
8034 type Message = MavMessage;
8035 const ID: u32 = 277u32;
8036 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
8037 const EXTRA_CRC: u8 = 62u8;
8038 const ENCODED_LEN: usize = 30usize;
8039 fn deser(
8040 _version: MavlinkVersion,
8041 __input: &[u8],
8042 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8043 let avail_len = __input.len();
8044 let mut payload_buf = [0; Self::ENCODED_LEN];
8045 let mut buf = if avail_len < Self::ENCODED_LEN {
8046 payload_buf[0..avail_len].copy_from_slice(__input);
8047 Bytes::new(&payload_buf)
8048 } else {
8049 Bytes::new(__input)
8050 };
8051 let mut __struct = Self::default();
8052 __struct.time_boot_ms = buf.get_u32_le()?;
8053 __struct.max = buf.get_f32_le()?;
8054 __struct.max_point_x = buf.get_f32_le()?;
8055 __struct.max_point_y = buf.get_f32_le()?;
8056 __struct.min = buf.get_f32_le()?;
8057 __struct.min_point_x = buf.get_f32_le()?;
8058 __struct.min_point_y = buf.get_f32_le()?;
8059 __struct.stream_id = buf.get_u8()?;
8060 __struct.camera_device_id = buf.get_u8()?;
8061 Ok(__struct)
8062 }
8063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8064 let mut __tmp = BytesMut::new(bytes);
8065 #[allow(clippy::absurd_extreme_comparisons)]
8066 #[allow(unused_comparisons)]
8067 if __tmp.remaining() < Self::ENCODED_LEN {
8068 panic!(
8069 "buffer is too small (need {} bytes, but got {})",
8070 Self::ENCODED_LEN,
8071 __tmp.remaining(),
8072 )
8073 }
8074 __tmp.put_u32_le(self.time_boot_ms);
8075 __tmp.put_f32_le(self.max);
8076 __tmp.put_f32_le(self.max_point_x);
8077 __tmp.put_f32_le(self.max_point_y);
8078 __tmp.put_f32_le(self.min);
8079 __tmp.put_f32_le(self.min_point_x);
8080 __tmp.put_f32_le(self.min_point_y);
8081 __tmp.put_u8(self.stream_id);
8082 __tmp.put_u8(self.camera_device_id);
8083 if matches!(version, MavlinkVersion::V2) {
8084 let len = __tmp.len();
8085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8086 } else {
8087 __tmp.len()
8088 }
8089 }
8090}
8091#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8092#[doc = ""]
8093#[doc = "ID: 276"]
8094#[derive(Debug, Clone, PartialEq)]
8095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8097#[cfg_attr(feature = "ts", derive(TS))]
8098#[cfg_attr(feature = "ts", ts(export))]
8099pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
8100 #[doc = "Latitude of tracked object"]
8101 pub lat: i32,
8102 #[doc = "Longitude of tracked object"]
8103 pub lon: i32,
8104 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
8105 pub alt: f32,
8106 #[doc = "Horizontal accuracy. NAN if unknown"]
8107 pub h_acc: f32,
8108 #[doc = "Vertical accuracy. NAN if unknown"]
8109 pub v_acc: f32,
8110 #[doc = "North velocity of tracked object. NAN if unknown"]
8111 pub vel_n: f32,
8112 #[doc = "East velocity of tracked object. NAN if unknown"]
8113 pub vel_e: f32,
8114 #[doc = "Down velocity of tracked object. NAN if unknown"]
8115 pub vel_d: f32,
8116 #[doc = "Velocity accuracy. NAN if unknown"]
8117 pub vel_acc: f32,
8118 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8119 pub dist: f32,
8120 #[doc = "Heading in radians, in NED. NAN if unknown"]
8121 pub hdg: f32,
8122 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8123 pub hdg_acc: f32,
8124 #[doc = "Current tracking status"]
8125 pub tracking_status: CameraTrackingStatusFlags,
8126 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8127 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8128 pub camera_device_id: u8,
8129}
8130impl CAMERA_TRACKING_GEO_STATUS_DATA {
8131 pub const ENCODED_LEN: usize = 50usize;
8132 pub const DEFAULT: Self = Self {
8133 lat: 0_i32,
8134 lon: 0_i32,
8135 alt: 0.0_f32,
8136 h_acc: 0.0_f32,
8137 v_acc: 0.0_f32,
8138 vel_n: 0.0_f32,
8139 vel_e: 0.0_f32,
8140 vel_d: 0.0_f32,
8141 vel_acc: 0.0_f32,
8142 dist: 0.0_f32,
8143 hdg: 0.0_f32,
8144 hdg_acc: 0.0_f32,
8145 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8146 camera_device_id: 0_u8,
8147 };
8148 #[cfg(feature = "arbitrary")]
8149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8150 use arbitrary::{Arbitrary, Unstructured};
8151 let mut buf = [0u8; 1024];
8152 rng.fill_bytes(&mut buf);
8153 let mut unstructured = Unstructured::new(&buf);
8154 Self::arbitrary(&mut unstructured).unwrap_or_default()
8155 }
8156}
8157impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8158 fn default() -> Self {
8159 Self::DEFAULT.clone()
8160 }
8161}
8162impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8163 type Message = MavMessage;
8164 const ID: u32 = 276u32;
8165 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8166 const EXTRA_CRC: u8 = 18u8;
8167 const ENCODED_LEN: usize = 50usize;
8168 fn deser(
8169 _version: MavlinkVersion,
8170 __input: &[u8],
8171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8172 let avail_len = __input.len();
8173 let mut payload_buf = [0; Self::ENCODED_LEN];
8174 let mut buf = if avail_len < Self::ENCODED_LEN {
8175 payload_buf[0..avail_len].copy_from_slice(__input);
8176 Bytes::new(&payload_buf)
8177 } else {
8178 Bytes::new(__input)
8179 };
8180 let mut __struct = Self::default();
8181 __struct.lat = buf.get_i32_le()?;
8182 __struct.lon = buf.get_i32_le()?;
8183 __struct.alt = buf.get_f32_le()?;
8184 __struct.h_acc = buf.get_f32_le()?;
8185 __struct.v_acc = buf.get_f32_le()?;
8186 __struct.vel_n = buf.get_f32_le()?;
8187 __struct.vel_e = buf.get_f32_le()?;
8188 __struct.vel_d = buf.get_f32_le()?;
8189 __struct.vel_acc = buf.get_f32_le()?;
8190 __struct.dist = buf.get_f32_le()?;
8191 __struct.hdg = buf.get_f32_le()?;
8192 __struct.hdg_acc = buf.get_f32_le()?;
8193 let tmp = buf.get_u8()?;
8194 __struct.tracking_status =
8195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8196 enum_type: "CameraTrackingStatusFlags",
8197 value: tmp as u64,
8198 })?;
8199 __struct.camera_device_id = buf.get_u8()?;
8200 Ok(__struct)
8201 }
8202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8203 let mut __tmp = BytesMut::new(bytes);
8204 #[allow(clippy::absurd_extreme_comparisons)]
8205 #[allow(unused_comparisons)]
8206 if __tmp.remaining() < Self::ENCODED_LEN {
8207 panic!(
8208 "buffer is too small (need {} bytes, but got {})",
8209 Self::ENCODED_LEN,
8210 __tmp.remaining(),
8211 )
8212 }
8213 __tmp.put_i32_le(self.lat);
8214 __tmp.put_i32_le(self.lon);
8215 __tmp.put_f32_le(self.alt);
8216 __tmp.put_f32_le(self.h_acc);
8217 __tmp.put_f32_le(self.v_acc);
8218 __tmp.put_f32_le(self.vel_n);
8219 __tmp.put_f32_le(self.vel_e);
8220 __tmp.put_f32_le(self.vel_d);
8221 __tmp.put_f32_le(self.vel_acc);
8222 __tmp.put_f32_le(self.dist);
8223 __tmp.put_f32_le(self.hdg);
8224 __tmp.put_f32_le(self.hdg_acc);
8225 __tmp.put_u8(self.tracking_status as u8);
8226 if matches!(version, MavlinkVersion::V2) {
8227 __tmp.put_u8(self.camera_device_id);
8228 let len = __tmp.len();
8229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8230 } else {
8231 __tmp.len()
8232 }
8233 }
8234}
8235#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8236#[doc = ""]
8237#[doc = "ID: 275"]
8238#[derive(Debug, Clone, PartialEq)]
8239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8241#[cfg_attr(feature = "ts", derive(TS))]
8242#[cfg_attr(feature = "ts", ts(export))]
8243pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8244 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8245 pub point_x: f32,
8246 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8247 pub point_y: f32,
8248 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8249 pub radius: f32,
8250 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8251 pub rec_top_x: f32,
8252 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8253 pub rec_top_y: f32,
8254 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8255 pub rec_bottom_x: f32,
8256 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8257 pub rec_bottom_y: f32,
8258 #[doc = "Current tracking status"]
8259 pub tracking_status: CameraTrackingStatusFlags,
8260 #[doc = "Current tracking mode"]
8261 pub tracking_mode: CameraTrackingMode,
8262 #[doc = "Defines location of target data"]
8263 pub target_data: CameraTrackingTargetData,
8264 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8265 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8266 pub camera_device_id: u8,
8267}
8268impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8269 pub const ENCODED_LEN: usize = 32usize;
8270 pub const DEFAULT: Self = Self {
8271 point_x: 0.0_f32,
8272 point_y: 0.0_f32,
8273 radius: 0.0_f32,
8274 rec_top_x: 0.0_f32,
8275 rec_top_y: 0.0_f32,
8276 rec_bottom_x: 0.0_f32,
8277 rec_bottom_y: 0.0_f32,
8278 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8279 tracking_mode: CameraTrackingMode::DEFAULT,
8280 target_data: CameraTrackingTargetData::DEFAULT,
8281 camera_device_id: 0_u8,
8282 };
8283 #[cfg(feature = "arbitrary")]
8284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8285 use arbitrary::{Arbitrary, Unstructured};
8286 let mut buf = [0u8; 1024];
8287 rng.fill_bytes(&mut buf);
8288 let mut unstructured = Unstructured::new(&buf);
8289 Self::arbitrary(&mut unstructured).unwrap_or_default()
8290 }
8291}
8292impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8293 fn default() -> Self {
8294 Self::DEFAULT.clone()
8295 }
8296}
8297impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8298 type Message = MavMessage;
8299 const ID: u32 = 275u32;
8300 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8301 const EXTRA_CRC: u8 = 126u8;
8302 const ENCODED_LEN: usize = 32usize;
8303 fn deser(
8304 _version: MavlinkVersion,
8305 __input: &[u8],
8306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8307 let avail_len = __input.len();
8308 let mut payload_buf = [0; Self::ENCODED_LEN];
8309 let mut buf = if avail_len < Self::ENCODED_LEN {
8310 payload_buf[0..avail_len].copy_from_slice(__input);
8311 Bytes::new(&payload_buf)
8312 } else {
8313 Bytes::new(__input)
8314 };
8315 let mut __struct = Self::default();
8316 __struct.point_x = buf.get_f32_le()?;
8317 __struct.point_y = buf.get_f32_le()?;
8318 __struct.radius = buf.get_f32_le()?;
8319 __struct.rec_top_x = buf.get_f32_le()?;
8320 __struct.rec_top_y = buf.get_f32_le()?;
8321 __struct.rec_bottom_x = buf.get_f32_le()?;
8322 __struct.rec_bottom_y = buf.get_f32_le()?;
8323 let tmp = buf.get_u8()?;
8324 __struct.tracking_status =
8325 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8326 enum_type: "CameraTrackingStatusFlags",
8327 value: tmp as u64,
8328 })?;
8329 let tmp = buf.get_u8()?;
8330 __struct.tracking_mode =
8331 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8332 enum_type: "CameraTrackingMode",
8333 value: tmp as u64,
8334 })?;
8335 let tmp = buf.get_u8()?;
8336 __struct.target_data =
8337 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
8338 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8339 flag_type: "CameraTrackingTargetData",
8340 value: tmp as u64,
8341 })?;
8342 __struct.camera_device_id = buf.get_u8()?;
8343 Ok(__struct)
8344 }
8345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8346 let mut __tmp = BytesMut::new(bytes);
8347 #[allow(clippy::absurd_extreme_comparisons)]
8348 #[allow(unused_comparisons)]
8349 if __tmp.remaining() < Self::ENCODED_LEN {
8350 panic!(
8351 "buffer is too small (need {} bytes, but got {})",
8352 Self::ENCODED_LEN,
8353 __tmp.remaining(),
8354 )
8355 }
8356 __tmp.put_f32_le(self.point_x);
8357 __tmp.put_f32_le(self.point_y);
8358 __tmp.put_f32_le(self.radius);
8359 __tmp.put_f32_le(self.rec_top_x);
8360 __tmp.put_f32_le(self.rec_top_y);
8361 __tmp.put_f32_le(self.rec_bottom_x);
8362 __tmp.put_f32_le(self.rec_bottom_y);
8363 __tmp.put_u8(self.tracking_status as u8);
8364 __tmp.put_u8(self.tracking_mode as u8);
8365 __tmp.put_u8(self.target_data.bits() as u8);
8366 if matches!(version, MavlinkVersion::V2) {
8367 __tmp.put_u8(self.camera_device_id);
8368 let len = __tmp.len();
8369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8370 } else {
8371 __tmp.len()
8372 }
8373 }
8374}
8375#[doc = "Camera-IMU triggering and synchronisation message."]
8376#[doc = ""]
8377#[doc = "ID: 112"]
8378#[derive(Debug, Clone, PartialEq)]
8379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8381#[cfg_attr(feature = "ts", derive(TS))]
8382#[cfg_attr(feature = "ts", ts(export))]
8383pub struct CAMERA_TRIGGER_DATA {
8384 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8385 pub time_usec: u64,
8386 #[doc = "Image frame sequence"]
8387 pub seq: u32,
8388}
8389impl CAMERA_TRIGGER_DATA {
8390 pub const ENCODED_LEN: usize = 12usize;
8391 pub const DEFAULT: Self = Self {
8392 time_usec: 0_u64,
8393 seq: 0_u32,
8394 };
8395 #[cfg(feature = "arbitrary")]
8396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8397 use arbitrary::{Arbitrary, Unstructured};
8398 let mut buf = [0u8; 1024];
8399 rng.fill_bytes(&mut buf);
8400 let mut unstructured = Unstructured::new(&buf);
8401 Self::arbitrary(&mut unstructured).unwrap_or_default()
8402 }
8403}
8404impl Default for CAMERA_TRIGGER_DATA {
8405 fn default() -> Self {
8406 Self::DEFAULT.clone()
8407 }
8408}
8409impl MessageData for CAMERA_TRIGGER_DATA {
8410 type Message = MavMessage;
8411 const ID: u32 = 112u32;
8412 const NAME: &'static str = "CAMERA_TRIGGER";
8413 const EXTRA_CRC: u8 = 174u8;
8414 const ENCODED_LEN: usize = 12usize;
8415 fn deser(
8416 _version: MavlinkVersion,
8417 __input: &[u8],
8418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8419 let avail_len = __input.len();
8420 let mut payload_buf = [0; Self::ENCODED_LEN];
8421 let mut buf = if avail_len < Self::ENCODED_LEN {
8422 payload_buf[0..avail_len].copy_from_slice(__input);
8423 Bytes::new(&payload_buf)
8424 } else {
8425 Bytes::new(__input)
8426 };
8427 let mut __struct = Self::default();
8428 __struct.time_usec = buf.get_u64_le()?;
8429 __struct.seq = buf.get_u32_le()?;
8430 Ok(__struct)
8431 }
8432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8433 let mut __tmp = BytesMut::new(bytes);
8434 #[allow(clippy::absurd_extreme_comparisons)]
8435 #[allow(unused_comparisons)]
8436 if __tmp.remaining() < Self::ENCODED_LEN {
8437 panic!(
8438 "buffer is too small (need {} bytes, but got {})",
8439 Self::ENCODED_LEN,
8440 __tmp.remaining(),
8441 )
8442 }
8443 __tmp.put_u64_le(self.time_usec);
8444 __tmp.put_u32_le(self.seq);
8445 if matches!(version, MavlinkVersion::V2) {
8446 let len = __tmp.len();
8447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8448 } else {
8449 __tmp.len()
8450 }
8451 }
8452}
8453#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8454#[doc = ""]
8455#[doc = "ID: 387"]
8456#[derive(Debug, Clone, PartialEq)]
8457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8459#[cfg_attr(feature = "ts", derive(TS))]
8460#[cfg_attr(feature = "ts", ts(export))]
8461pub struct CANFD_FRAME_DATA {
8462 #[doc = "Frame ID"]
8463 pub id: u32,
8464 #[doc = "System ID."]
8465 pub target_system: u8,
8466 #[doc = "Component ID."]
8467 pub target_component: u8,
8468 #[doc = "bus number"]
8469 pub bus: u8,
8470 #[doc = "Frame length"]
8471 pub len: u8,
8472 #[doc = "Frame data"]
8473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8474 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8475 pub data: [u8; 64],
8476}
8477impl CANFD_FRAME_DATA {
8478 pub const ENCODED_LEN: usize = 72usize;
8479 pub const DEFAULT: Self = Self {
8480 id: 0_u32,
8481 target_system: 0_u8,
8482 target_component: 0_u8,
8483 bus: 0_u8,
8484 len: 0_u8,
8485 data: [0_u8; 64usize],
8486 };
8487 #[cfg(feature = "arbitrary")]
8488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8489 use arbitrary::{Arbitrary, Unstructured};
8490 let mut buf = [0u8; 1024];
8491 rng.fill_bytes(&mut buf);
8492 let mut unstructured = Unstructured::new(&buf);
8493 Self::arbitrary(&mut unstructured).unwrap_or_default()
8494 }
8495}
8496impl Default for CANFD_FRAME_DATA {
8497 fn default() -> Self {
8498 Self::DEFAULT.clone()
8499 }
8500}
8501impl MessageData for CANFD_FRAME_DATA {
8502 type Message = MavMessage;
8503 const ID: u32 = 387u32;
8504 const NAME: &'static str = "CANFD_FRAME";
8505 const EXTRA_CRC: u8 = 4u8;
8506 const ENCODED_LEN: usize = 72usize;
8507 fn deser(
8508 _version: MavlinkVersion,
8509 __input: &[u8],
8510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8511 let avail_len = __input.len();
8512 let mut payload_buf = [0; Self::ENCODED_LEN];
8513 let mut buf = if avail_len < Self::ENCODED_LEN {
8514 payload_buf[0..avail_len].copy_from_slice(__input);
8515 Bytes::new(&payload_buf)
8516 } else {
8517 Bytes::new(__input)
8518 };
8519 let mut __struct = Self::default();
8520 __struct.id = buf.get_u32_le()?;
8521 __struct.target_system = buf.get_u8()?;
8522 __struct.target_component = buf.get_u8()?;
8523 __struct.bus = buf.get_u8()?;
8524 __struct.len = buf.get_u8()?;
8525 for v in &mut __struct.data {
8526 let val = buf.get_u8()?;
8527 *v = val;
8528 }
8529 Ok(__struct)
8530 }
8531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8532 let mut __tmp = BytesMut::new(bytes);
8533 #[allow(clippy::absurd_extreme_comparisons)]
8534 #[allow(unused_comparisons)]
8535 if __tmp.remaining() < Self::ENCODED_LEN {
8536 panic!(
8537 "buffer is too small (need {} bytes, but got {})",
8538 Self::ENCODED_LEN,
8539 __tmp.remaining(),
8540 )
8541 }
8542 __tmp.put_u32_le(self.id);
8543 __tmp.put_u8(self.target_system);
8544 __tmp.put_u8(self.target_component);
8545 __tmp.put_u8(self.bus);
8546 __tmp.put_u8(self.len);
8547 for val in &self.data {
8548 __tmp.put_u8(*val);
8549 }
8550 if matches!(version, MavlinkVersion::V2) {
8551 let len = __tmp.len();
8552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8553 } else {
8554 __tmp.len()
8555 }
8556 }
8557}
8558#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8559#[doc = ""]
8560#[doc = "ID: 388"]
8561#[derive(Debug, Clone, PartialEq)]
8562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8564#[cfg_attr(feature = "ts", derive(TS))]
8565#[cfg_attr(feature = "ts", ts(export))]
8566pub struct CAN_FILTER_MODIFY_DATA {
8567 #[doc = "filter IDs, length num_ids"]
8568 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8569 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8570 pub ids: [u16; 16],
8571 #[doc = "System ID."]
8572 pub target_system: u8,
8573 #[doc = "Component ID."]
8574 pub target_component: u8,
8575 #[doc = "bus number"]
8576 pub bus: u8,
8577 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8578 pub operation: CanFilterOp,
8579 #[doc = "number of IDs in filter list"]
8580 pub num_ids: u8,
8581}
8582impl CAN_FILTER_MODIFY_DATA {
8583 pub const ENCODED_LEN: usize = 37usize;
8584 pub const DEFAULT: Self = Self {
8585 ids: [0_u16; 16usize],
8586 target_system: 0_u8,
8587 target_component: 0_u8,
8588 bus: 0_u8,
8589 operation: CanFilterOp::DEFAULT,
8590 num_ids: 0_u8,
8591 };
8592 #[cfg(feature = "arbitrary")]
8593 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8594 use arbitrary::{Arbitrary, Unstructured};
8595 let mut buf = [0u8; 1024];
8596 rng.fill_bytes(&mut buf);
8597 let mut unstructured = Unstructured::new(&buf);
8598 Self::arbitrary(&mut unstructured).unwrap_or_default()
8599 }
8600}
8601impl Default for CAN_FILTER_MODIFY_DATA {
8602 fn default() -> Self {
8603 Self::DEFAULT.clone()
8604 }
8605}
8606impl MessageData for CAN_FILTER_MODIFY_DATA {
8607 type Message = MavMessage;
8608 const ID: u32 = 388u32;
8609 const NAME: &'static str = "CAN_FILTER_MODIFY";
8610 const EXTRA_CRC: u8 = 8u8;
8611 const ENCODED_LEN: usize = 37usize;
8612 fn deser(
8613 _version: MavlinkVersion,
8614 __input: &[u8],
8615 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8616 let avail_len = __input.len();
8617 let mut payload_buf = [0; Self::ENCODED_LEN];
8618 let mut buf = if avail_len < Self::ENCODED_LEN {
8619 payload_buf[0..avail_len].copy_from_slice(__input);
8620 Bytes::new(&payload_buf)
8621 } else {
8622 Bytes::new(__input)
8623 };
8624 let mut __struct = Self::default();
8625 for v in &mut __struct.ids {
8626 let val = buf.get_u16_le()?;
8627 *v = val;
8628 }
8629 __struct.target_system = buf.get_u8()?;
8630 __struct.target_component = buf.get_u8()?;
8631 __struct.bus = buf.get_u8()?;
8632 let tmp = buf.get_u8()?;
8633 __struct.operation =
8634 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8635 enum_type: "CanFilterOp",
8636 value: tmp as u64,
8637 })?;
8638 __struct.num_ids = buf.get_u8()?;
8639 Ok(__struct)
8640 }
8641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8642 let mut __tmp = BytesMut::new(bytes);
8643 #[allow(clippy::absurd_extreme_comparisons)]
8644 #[allow(unused_comparisons)]
8645 if __tmp.remaining() < Self::ENCODED_LEN {
8646 panic!(
8647 "buffer is too small (need {} bytes, but got {})",
8648 Self::ENCODED_LEN,
8649 __tmp.remaining(),
8650 )
8651 }
8652 for val in &self.ids {
8653 __tmp.put_u16_le(*val);
8654 }
8655 __tmp.put_u8(self.target_system);
8656 __tmp.put_u8(self.target_component);
8657 __tmp.put_u8(self.bus);
8658 __tmp.put_u8(self.operation as u8);
8659 __tmp.put_u8(self.num_ids);
8660 if matches!(version, MavlinkVersion::V2) {
8661 let len = __tmp.len();
8662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8663 } else {
8664 __tmp.len()
8665 }
8666 }
8667}
8668#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8669#[doc = ""]
8670#[doc = "ID: 386"]
8671#[derive(Debug, Clone, PartialEq)]
8672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8674#[cfg_attr(feature = "ts", derive(TS))]
8675#[cfg_attr(feature = "ts", ts(export))]
8676pub struct CAN_FRAME_DATA {
8677 #[doc = "Frame ID"]
8678 pub id: u32,
8679 #[doc = "System ID."]
8680 pub target_system: u8,
8681 #[doc = "Component ID."]
8682 pub target_component: u8,
8683 #[doc = "Bus number"]
8684 pub bus: u8,
8685 #[doc = "Frame length"]
8686 pub len: u8,
8687 #[doc = "Frame data"]
8688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8689 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8690 pub data: [u8; 8],
8691}
8692impl CAN_FRAME_DATA {
8693 pub const ENCODED_LEN: usize = 16usize;
8694 pub const DEFAULT: Self = Self {
8695 id: 0_u32,
8696 target_system: 0_u8,
8697 target_component: 0_u8,
8698 bus: 0_u8,
8699 len: 0_u8,
8700 data: [0_u8; 8usize],
8701 };
8702 #[cfg(feature = "arbitrary")]
8703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8704 use arbitrary::{Arbitrary, Unstructured};
8705 let mut buf = [0u8; 1024];
8706 rng.fill_bytes(&mut buf);
8707 let mut unstructured = Unstructured::new(&buf);
8708 Self::arbitrary(&mut unstructured).unwrap_or_default()
8709 }
8710}
8711impl Default for CAN_FRAME_DATA {
8712 fn default() -> Self {
8713 Self::DEFAULT.clone()
8714 }
8715}
8716impl MessageData for CAN_FRAME_DATA {
8717 type Message = MavMessage;
8718 const ID: u32 = 386u32;
8719 const NAME: &'static str = "CAN_FRAME";
8720 const EXTRA_CRC: u8 = 132u8;
8721 const ENCODED_LEN: usize = 16usize;
8722 fn deser(
8723 _version: MavlinkVersion,
8724 __input: &[u8],
8725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8726 let avail_len = __input.len();
8727 let mut payload_buf = [0; Self::ENCODED_LEN];
8728 let mut buf = if avail_len < Self::ENCODED_LEN {
8729 payload_buf[0..avail_len].copy_from_slice(__input);
8730 Bytes::new(&payload_buf)
8731 } else {
8732 Bytes::new(__input)
8733 };
8734 let mut __struct = Self::default();
8735 __struct.id = buf.get_u32_le()?;
8736 __struct.target_system = buf.get_u8()?;
8737 __struct.target_component = buf.get_u8()?;
8738 __struct.bus = buf.get_u8()?;
8739 __struct.len = buf.get_u8()?;
8740 for v in &mut __struct.data {
8741 let val = buf.get_u8()?;
8742 *v = val;
8743 }
8744 Ok(__struct)
8745 }
8746 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8747 let mut __tmp = BytesMut::new(bytes);
8748 #[allow(clippy::absurd_extreme_comparisons)]
8749 #[allow(unused_comparisons)]
8750 if __tmp.remaining() < Self::ENCODED_LEN {
8751 panic!(
8752 "buffer is too small (need {} bytes, but got {})",
8753 Self::ENCODED_LEN,
8754 __tmp.remaining(),
8755 )
8756 }
8757 __tmp.put_u32_le(self.id);
8758 __tmp.put_u8(self.target_system);
8759 __tmp.put_u8(self.target_component);
8760 __tmp.put_u8(self.bus);
8761 __tmp.put_u8(self.len);
8762 for val in &self.data {
8763 __tmp.put_u8(*val);
8764 }
8765 if matches!(version, MavlinkVersion::V2) {
8766 let len = __tmp.len();
8767 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8768 } else {
8769 __tmp.len()
8770 }
8771 }
8772}
8773#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8774#[doc = ""]
8775#[doc = "ID: 336"]
8776#[derive(Debug, Clone, PartialEq)]
8777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8778#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8779#[cfg_attr(feature = "ts", derive(TS))]
8780#[cfg_attr(feature = "ts", ts(export))]
8781pub struct CELLULAR_CONFIG_DATA {
8782 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8783 pub enable_lte: u8,
8784 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8785 pub enable_pin: u8,
8786 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8787 #[cfg_attr(feature = "ts", ts(type = "string"))]
8788 pub pin: CharArray<16>,
8789 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8790 #[cfg_attr(feature = "ts", ts(type = "string"))]
8791 pub new_pin: CharArray<16>,
8792 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8793 #[cfg_attr(feature = "ts", ts(type = "string"))]
8794 pub apn: CharArray<32>,
8795 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8796 #[cfg_attr(feature = "ts", ts(type = "string"))]
8797 pub puk: CharArray<16>,
8798 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8799 pub roaming: u8,
8800 #[doc = "Message acceptance response (sent back to GS)."]
8801 pub response: CellularConfigResponse,
8802}
8803impl CELLULAR_CONFIG_DATA {
8804 pub const ENCODED_LEN: usize = 84usize;
8805 pub const DEFAULT: Self = Self {
8806 enable_lte: 0_u8,
8807 enable_pin: 0_u8,
8808 pin: CharArray::new([0_u8; 16usize]),
8809 new_pin: CharArray::new([0_u8; 16usize]),
8810 apn: CharArray::new([0_u8; 32usize]),
8811 puk: CharArray::new([0_u8; 16usize]),
8812 roaming: 0_u8,
8813 response: CellularConfigResponse::DEFAULT,
8814 };
8815 #[cfg(feature = "arbitrary")]
8816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8817 use arbitrary::{Arbitrary, Unstructured};
8818 let mut buf = [0u8; 1024];
8819 rng.fill_bytes(&mut buf);
8820 let mut unstructured = Unstructured::new(&buf);
8821 Self::arbitrary(&mut unstructured).unwrap_or_default()
8822 }
8823}
8824impl Default for CELLULAR_CONFIG_DATA {
8825 fn default() -> Self {
8826 Self::DEFAULT.clone()
8827 }
8828}
8829impl MessageData for CELLULAR_CONFIG_DATA {
8830 type Message = MavMessage;
8831 const ID: u32 = 336u32;
8832 const NAME: &'static str = "CELLULAR_CONFIG";
8833 const EXTRA_CRC: u8 = 245u8;
8834 const ENCODED_LEN: usize = 84usize;
8835 fn deser(
8836 _version: MavlinkVersion,
8837 __input: &[u8],
8838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8839 let avail_len = __input.len();
8840 let mut payload_buf = [0; Self::ENCODED_LEN];
8841 let mut buf = if avail_len < Self::ENCODED_LEN {
8842 payload_buf[0..avail_len].copy_from_slice(__input);
8843 Bytes::new(&payload_buf)
8844 } else {
8845 Bytes::new(__input)
8846 };
8847 let mut __struct = Self::default();
8848 __struct.enable_lte = buf.get_u8()?;
8849 __struct.enable_pin = buf.get_u8()?;
8850 let mut tmp = [0_u8; 16usize];
8851 for v in &mut tmp {
8852 *v = buf.get_u8()?;
8853 }
8854 __struct.pin = CharArray::new(tmp);
8855 let mut tmp = [0_u8; 16usize];
8856 for v in &mut tmp {
8857 *v = buf.get_u8()?;
8858 }
8859 __struct.new_pin = CharArray::new(tmp);
8860 let mut tmp = [0_u8; 32usize];
8861 for v in &mut tmp {
8862 *v = buf.get_u8()?;
8863 }
8864 __struct.apn = CharArray::new(tmp);
8865 let mut tmp = [0_u8; 16usize];
8866 for v in &mut tmp {
8867 *v = buf.get_u8()?;
8868 }
8869 __struct.puk = CharArray::new(tmp);
8870 __struct.roaming = buf.get_u8()?;
8871 let tmp = buf.get_u8()?;
8872 __struct.response =
8873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8874 enum_type: "CellularConfigResponse",
8875 value: tmp as u64,
8876 })?;
8877 Ok(__struct)
8878 }
8879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8880 let mut __tmp = BytesMut::new(bytes);
8881 #[allow(clippy::absurd_extreme_comparisons)]
8882 #[allow(unused_comparisons)]
8883 if __tmp.remaining() < Self::ENCODED_LEN {
8884 panic!(
8885 "buffer is too small (need {} bytes, but got {})",
8886 Self::ENCODED_LEN,
8887 __tmp.remaining(),
8888 )
8889 }
8890 __tmp.put_u8(self.enable_lte);
8891 __tmp.put_u8(self.enable_pin);
8892 for val in &self.pin {
8893 __tmp.put_u8(*val);
8894 }
8895 for val in &self.new_pin {
8896 __tmp.put_u8(*val);
8897 }
8898 for val in &self.apn {
8899 __tmp.put_u8(*val);
8900 }
8901 for val in &self.puk {
8902 __tmp.put_u8(*val);
8903 }
8904 __tmp.put_u8(self.roaming);
8905 __tmp.put_u8(self.response as u8);
8906 if matches!(version, MavlinkVersion::V2) {
8907 let len = __tmp.len();
8908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8909 } else {
8910 __tmp.len()
8911 }
8912 }
8913}
8914#[doc = "Report current used cellular network status."]
8915#[doc = ""]
8916#[doc = "ID: 334"]
8917#[derive(Debug, Clone, PartialEq)]
8918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8920#[cfg_attr(feature = "ts", derive(TS))]
8921#[cfg_attr(feature = "ts", ts(export))]
8922pub struct CELLULAR_STATUS_DATA {
8923 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8924 pub mcc: u16,
8925 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8926 pub mnc: u16,
8927 #[doc = "Location area code. If unknown, set to 0"]
8928 pub lac: u16,
8929 #[doc = "Cellular modem status"]
8930 pub status: CellularStatusFlag,
8931 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8932 pub failure_reason: CellularNetworkFailedReason,
8933 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8934 pub mavtype: CellularNetworkRadioType,
8935 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8936 pub quality: u8,
8937}
8938impl CELLULAR_STATUS_DATA {
8939 pub const ENCODED_LEN: usize = 10usize;
8940 pub const DEFAULT: Self = Self {
8941 mcc: 0_u16,
8942 mnc: 0_u16,
8943 lac: 0_u16,
8944 status: CellularStatusFlag::DEFAULT,
8945 failure_reason: CellularNetworkFailedReason::DEFAULT,
8946 mavtype: CellularNetworkRadioType::DEFAULT,
8947 quality: 0_u8,
8948 };
8949 #[cfg(feature = "arbitrary")]
8950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8951 use arbitrary::{Arbitrary, Unstructured};
8952 let mut buf = [0u8; 1024];
8953 rng.fill_bytes(&mut buf);
8954 let mut unstructured = Unstructured::new(&buf);
8955 Self::arbitrary(&mut unstructured).unwrap_or_default()
8956 }
8957}
8958impl Default for CELLULAR_STATUS_DATA {
8959 fn default() -> Self {
8960 Self::DEFAULT.clone()
8961 }
8962}
8963impl MessageData for CELLULAR_STATUS_DATA {
8964 type Message = MavMessage;
8965 const ID: u32 = 334u32;
8966 const NAME: &'static str = "CELLULAR_STATUS";
8967 const EXTRA_CRC: u8 = 72u8;
8968 const ENCODED_LEN: usize = 10usize;
8969 fn deser(
8970 _version: MavlinkVersion,
8971 __input: &[u8],
8972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8973 let avail_len = __input.len();
8974 let mut payload_buf = [0; Self::ENCODED_LEN];
8975 let mut buf = if avail_len < Self::ENCODED_LEN {
8976 payload_buf[0..avail_len].copy_from_slice(__input);
8977 Bytes::new(&payload_buf)
8978 } else {
8979 Bytes::new(__input)
8980 };
8981 let mut __struct = Self::default();
8982 __struct.mcc = buf.get_u16_le()?;
8983 __struct.mnc = buf.get_u16_le()?;
8984 __struct.lac = buf.get_u16_le()?;
8985 let tmp = buf.get_u8()?;
8986 __struct.status =
8987 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8988 enum_type: "CellularStatusFlag",
8989 value: tmp as u64,
8990 })?;
8991 let tmp = buf.get_u8()?;
8992 __struct.failure_reason =
8993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8994 enum_type: "CellularNetworkFailedReason",
8995 value: tmp as u64,
8996 })?;
8997 let tmp = buf.get_u8()?;
8998 __struct.mavtype =
8999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9000 enum_type: "CellularNetworkRadioType",
9001 value: tmp as u64,
9002 })?;
9003 __struct.quality = buf.get_u8()?;
9004 Ok(__struct)
9005 }
9006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9007 let mut __tmp = BytesMut::new(bytes);
9008 #[allow(clippy::absurd_extreme_comparisons)]
9009 #[allow(unused_comparisons)]
9010 if __tmp.remaining() < Self::ENCODED_LEN {
9011 panic!(
9012 "buffer is too small (need {} bytes, but got {})",
9013 Self::ENCODED_LEN,
9014 __tmp.remaining(),
9015 )
9016 }
9017 __tmp.put_u16_le(self.mcc);
9018 __tmp.put_u16_le(self.mnc);
9019 __tmp.put_u16_le(self.lac);
9020 __tmp.put_u8(self.status as u8);
9021 __tmp.put_u8(self.failure_reason as u8);
9022 __tmp.put_u8(self.mavtype as u8);
9023 __tmp.put_u8(self.quality);
9024 if matches!(version, MavlinkVersion::V2) {
9025 let len = __tmp.len();
9026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9027 } else {
9028 __tmp.len()
9029 }
9030 }
9031}
9032#[doc = "Request to control this MAV."]
9033#[doc = ""]
9034#[doc = "ID: 5"]
9035#[derive(Debug, Clone, PartialEq)]
9036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9038#[cfg_attr(feature = "ts", derive(TS))]
9039#[cfg_attr(feature = "ts", ts(export))]
9040pub struct CHANGE_OPERATOR_CONTROL_DATA {
9041 #[doc = "System the GCS requests control for"]
9042 pub target_system: u8,
9043 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9044 pub control_request: u8,
9045 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
9046 pub version: u8,
9047 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
9048 #[cfg_attr(feature = "ts", ts(type = "string"))]
9049 pub passkey: CharArray<25>,
9050}
9051impl CHANGE_OPERATOR_CONTROL_DATA {
9052 pub const ENCODED_LEN: usize = 28usize;
9053 pub const DEFAULT: Self = Self {
9054 target_system: 0_u8,
9055 control_request: 0_u8,
9056 version: 0_u8,
9057 passkey: CharArray::new([0_u8; 25usize]),
9058 };
9059 #[cfg(feature = "arbitrary")]
9060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9061 use arbitrary::{Arbitrary, Unstructured};
9062 let mut buf = [0u8; 1024];
9063 rng.fill_bytes(&mut buf);
9064 let mut unstructured = Unstructured::new(&buf);
9065 Self::arbitrary(&mut unstructured).unwrap_or_default()
9066 }
9067}
9068impl Default for CHANGE_OPERATOR_CONTROL_DATA {
9069 fn default() -> Self {
9070 Self::DEFAULT.clone()
9071 }
9072}
9073impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
9074 type Message = MavMessage;
9075 const ID: u32 = 5u32;
9076 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
9077 const EXTRA_CRC: u8 = 217u8;
9078 const ENCODED_LEN: usize = 28usize;
9079 fn deser(
9080 _version: MavlinkVersion,
9081 __input: &[u8],
9082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9083 let avail_len = __input.len();
9084 let mut payload_buf = [0; Self::ENCODED_LEN];
9085 let mut buf = if avail_len < Self::ENCODED_LEN {
9086 payload_buf[0..avail_len].copy_from_slice(__input);
9087 Bytes::new(&payload_buf)
9088 } else {
9089 Bytes::new(__input)
9090 };
9091 let mut __struct = Self::default();
9092 __struct.target_system = buf.get_u8()?;
9093 __struct.control_request = buf.get_u8()?;
9094 __struct.version = buf.get_u8()?;
9095 let mut tmp = [0_u8; 25usize];
9096 for v in &mut tmp {
9097 *v = buf.get_u8()?;
9098 }
9099 __struct.passkey = CharArray::new(tmp);
9100 Ok(__struct)
9101 }
9102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9103 let mut __tmp = BytesMut::new(bytes);
9104 #[allow(clippy::absurd_extreme_comparisons)]
9105 #[allow(unused_comparisons)]
9106 if __tmp.remaining() < Self::ENCODED_LEN {
9107 panic!(
9108 "buffer is too small (need {} bytes, but got {})",
9109 Self::ENCODED_LEN,
9110 __tmp.remaining(),
9111 )
9112 }
9113 __tmp.put_u8(self.target_system);
9114 __tmp.put_u8(self.control_request);
9115 __tmp.put_u8(self.version);
9116 for val in &self.passkey {
9117 __tmp.put_u8(*val);
9118 }
9119 if matches!(version, MavlinkVersion::V2) {
9120 let len = __tmp.len();
9121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9122 } else {
9123 __tmp.len()
9124 }
9125 }
9126}
9127#[doc = "Accept / deny control of this MAV."]
9128#[doc = ""]
9129#[doc = "ID: 6"]
9130#[derive(Debug, Clone, PartialEq)]
9131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9133#[cfg_attr(feature = "ts", derive(TS))]
9134#[cfg_attr(feature = "ts", ts(export))]
9135pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9136 #[doc = "ID of the GCS this message"]
9137 pub gcs_system_id: u8,
9138 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9139 pub control_request: u8,
9140 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9141 pub ack: u8,
9142}
9143impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9144 pub const ENCODED_LEN: usize = 3usize;
9145 pub const DEFAULT: Self = Self {
9146 gcs_system_id: 0_u8,
9147 control_request: 0_u8,
9148 ack: 0_u8,
9149 };
9150 #[cfg(feature = "arbitrary")]
9151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9152 use arbitrary::{Arbitrary, Unstructured};
9153 let mut buf = [0u8; 1024];
9154 rng.fill_bytes(&mut buf);
9155 let mut unstructured = Unstructured::new(&buf);
9156 Self::arbitrary(&mut unstructured).unwrap_or_default()
9157 }
9158}
9159impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9160 fn default() -> Self {
9161 Self::DEFAULT.clone()
9162 }
9163}
9164impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9165 type Message = MavMessage;
9166 const ID: u32 = 6u32;
9167 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9168 const EXTRA_CRC: u8 = 104u8;
9169 const ENCODED_LEN: usize = 3usize;
9170 fn deser(
9171 _version: MavlinkVersion,
9172 __input: &[u8],
9173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9174 let avail_len = __input.len();
9175 let mut payload_buf = [0; Self::ENCODED_LEN];
9176 let mut buf = if avail_len < Self::ENCODED_LEN {
9177 payload_buf[0..avail_len].copy_from_slice(__input);
9178 Bytes::new(&payload_buf)
9179 } else {
9180 Bytes::new(__input)
9181 };
9182 let mut __struct = Self::default();
9183 __struct.gcs_system_id = buf.get_u8()?;
9184 __struct.control_request = buf.get_u8()?;
9185 __struct.ack = buf.get_u8()?;
9186 Ok(__struct)
9187 }
9188 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9189 let mut __tmp = BytesMut::new(bytes);
9190 #[allow(clippy::absurd_extreme_comparisons)]
9191 #[allow(unused_comparisons)]
9192 if __tmp.remaining() < Self::ENCODED_LEN {
9193 panic!(
9194 "buffer is too small (need {} bytes, but got {})",
9195 Self::ENCODED_LEN,
9196 __tmp.remaining(),
9197 )
9198 }
9199 __tmp.put_u8(self.gcs_system_id);
9200 __tmp.put_u8(self.control_request);
9201 __tmp.put_u8(self.ack);
9202 if matches!(version, MavlinkVersion::V2) {
9203 let len = __tmp.len();
9204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9205 } else {
9206 __tmp.len()
9207 }
9208 }
9209}
9210#[doc = "Information about a potential collision."]
9211#[doc = ""]
9212#[doc = "ID: 247"]
9213#[derive(Debug, Clone, PartialEq)]
9214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9216#[cfg_attr(feature = "ts", derive(TS))]
9217#[cfg_attr(feature = "ts", ts(export))]
9218pub struct COLLISION_DATA {
9219 #[doc = "Unique identifier, domain based on src field"]
9220 pub id: u32,
9221 #[doc = "Estimated time until collision occurs"]
9222 pub time_to_minimum_delta: f32,
9223 #[doc = "Closest vertical distance between vehicle and object"]
9224 pub altitude_minimum_delta: f32,
9225 #[doc = "Closest horizontal distance between vehicle and object"]
9226 pub horizontal_minimum_delta: f32,
9227 #[doc = "Collision data source"]
9228 pub src: MavCollisionSrc,
9229 #[doc = "Action that is being taken to avoid this collision"]
9230 pub action: MavCollisionAction,
9231 #[doc = "How concerned the aircraft is about this collision"]
9232 pub threat_level: MavCollisionThreatLevel,
9233}
9234impl COLLISION_DATA {
9235 pub const ENCODED_LEN: usize = 19usize;
9236 pub const DEFAULT: Self = Self {
9237 id: 0_u32,
9238 time_to_minimum_delta: 0.0_f32,
9239 altitude_minimum_delta: 0.0_f32,
9240 horizontal_minimum_delta: 0.0_f32,
9241 src: MavCollisionSrc::DEFAULT,
9242 action: MavCollisionAction::DEFAULT,
9243 threat_level: MavCollisionThreatLevel::DEFAULT,
9244 };
9245 #[cfg(feature = "arbitrary")]
9246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9247 use arbitrary::{Arbitrary, Unstructured};
9248 let mut buf = [0u8; 1024];
9249 rng.fill_bytes(&mut buf);
9250 let mut unstructured = Unstructured::new(&buf);
9251 Self::arbitrary(&mut unstructured).unwrap_or_default()
9252 }
9253}
9254impl Default for COLLISION_DATA {
9255 fn default() -> Self {
9256 Self::DEFAULT.clone()
9257 }
9258}
9259impl MessageData for COLLISION_DATA {
9260 type Message = MavMessage;
9261 const ID: u32 = 247u32;
9262 const NAME: &'static str = "COLLISION";
9263 const EXTRA_CRC: u8 = 81u8;
9264 const ENCODED_LEN: usize = 19usize;
9265 fn deser(
9266 _version: MavlinkVersion,
9267 __input: &[u8],
9268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9269 let avail_len = __input.len();
9270 let mut payload_buf = [0; Self::ENCODED_LEN];
9271 let mut buf = if avail_len < Self::ENCODED_LEN {
9272 payload_buf[0..avail_len].copy_from_slice(__input);
9273 Bytes::new(&payload_buf)
9274 } else {
9275 Bytes::new(__input)
9276 };
9277 let mut __struct = Self::default();
9278 __struct.id = buf.get_u32_le()?;
9279 __struct.time_to_minimum_delta = buf.get_f32_le()?;
9280 __struct.altitude_minimum_delta = buf.get_f32_le()?;
9281 __struct.horizontal_minimum_delta = buf.get_f32_le()?;
9282 let tmp = buf.get_u8()?;
9283 __struct.src =
9284 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9285 enum_type: "MavCollisionSrc",
9286 value: tmp as u64,
9287 })?;
9288 let tmp = buf.get_u8()?;
9289 __struct.action =
9290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9291 enum_type: "MavCollisionAction",
9292 value: tmp as u64,
9293 })?;
9294 let tmp = buf.get_u8()?;
9295 __struct.threat_level =
9296 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9297 enum_type: "MavCollisionThreatLevel",
9298 value: tmp as u64,
9299 })?;
9300 Ok(__struct)
9301 }
9302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9303 let mut __tmp = BytesMut::new(bytes);
9304 #[allow(clippy::absurd_extreme_comparisons)]
9305 #[allow(unused_comparisons)]
9306 if __tmp.remaining() < Self::ENCODED_LEN {
9307 panic!(
9308 "buffer is too small (need {} bytes, but got {})",
9309 Self::ENCODED_LEN,
9310 __tmp.remaining(),
9311 )
9312 }
9313 __tmp.put_u32_le(self.id);
9314 __tmp.put_f32_le(self.time_to_minimum_delta);
9315 __tmp.put_f32_le(self.altitude_minimum_delta);
9316 __tmp.put_f32_le(self.horizontal_minimum_delta);
9317 __tmp.put_u8(self.src as u8);
9318 __tmp.put_u8(self.action as u8);
9319 __tmp.put_u8(self.threat_level as u8);
9320 if matches!(version, MavlinkVersion::V2) {
9321 let len = __tmp.len();
9322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9323 } else {
9324 __tmp.len()
9325 }
9326 }
9327}
9328#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9329#[doc = ""]
9330#[doc = "ID: 77"]
9331#[derive(Debug, Clone, PartialEq)]
9332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9334#[cfg_attr(feature = "ts", derive(TS))]
9335#[cfg_attr(feature = "ts", ts(export))]
9336pub struct COMMAND_ACK_DATA {
9337 #[doc = "Command ID (of acknowledged command)."]
9338 pub command: MavCmd,
9339 #[doc = "Result of command."]
9340 pub result: MavResult,
9341 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9342 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9343 pub progress: u8,
9344 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9346 pub result_param2: i32,
9347 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9348 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9349 pub target_system: u8,
9350 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9352 pub target_component: u8,
9353}
9354impl COMMAND_ACK_DATA {
9355 pub const ENCODED_LEN: usize = 10usize;
9356 pub const DEFAULT: Self = Self {
9357 command: MavCmd::DEFAULT,
9358 result: MavResult::DEFAULT,
9359 progress: 0_u8,
9360 result_param2: 0_i32,
9361 target_system: 0_u8,
9362 target_component: 0_u8,
9363 };
9364 #[cfg(feature = "arbitrary")]
9365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9366 use arbitrary::{Arbitrary, Unstructured};
9367 let mut buf = [0u8; 1024];
9368 rng.fill_bytes(&mut buf);
9369 let mut unstructured = Unstructured::new(&buf);
9370 Self::arbitrary(&mut unstructured).unwrap_or_default()
9371 }
9372}
9373impl Default for COMMAND_ACK_DATA {
9374 fn default() -> Self {
9375 Self::DEFAULT.clone()
9376 }
9377}
9378impl MessageData for COMMAND_ACK_DATA {
9379 type Message = MavMessage;
9380 const ID: u32 = 77u32;
9381 const NAME: &'static str = "COMMAND_ACK";
9382 const EXTRA_CRC: u8 = 143u8;
9383 const ENCODED_LEN: usize = 10usize;
9384 fn deser(
9385 _version: MavlinkVersion,
9386 __input: &[u8],
9387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9388 let avail_len = __input.len();
9389 let mut payload_buf = [0; Self::ENCODED_LEN];
9390 let mut buf = if avail_len < Self::ENCODED_LEN {
9391 payload_buf[0..avail_len].copy_from_slice(__input);
9392 Bytes::new(&payload_buf)
9393 } else {
9394 Bytes::new(__input)
9395 };
9396 let mut __struct = Self::default();
9397 let tmp = buf.get_u16_le()?;
9398 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9399 ::mavlink_core::error::ParserError::InvalidEnum {
9400 enum_type: "MavCmd",
9401 value: tmp as u64,
9402 },
9403 )?;
9404 let tmp = buf.get_u8()?;
9405 __struct.result =
9406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9407 enum_type: "MavResult",
9408 value: tmp as u64,
9409 })?;
9410 __struct.progress = buf.get_u8()?;
9411 __struct.result_param2 = buf.get_i32_le()?;
9412 __struct.target_system = buf.get_u8()?;
9413 __struct.target_component = buf.get_u8()?;
9414 Ok(__struct)
9415 }
9416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9417 let mut __tmp = BytesMut::new(bytes);
9418 #[allow(clippy::absurd_extreme_comparisons)]
9419 #[allow(unused_comparisons)]
9420 if __tmp.remaining() < Self::ENCODED_LEN {
9421 panic!(
9422 "buffer is too small (need {} bytes, but got {})",
9423 Self::ENCODED_LEN,
9424 __tmp.remaining(),
9425 )
9426 }
9427 __tmp.put_u16_le(self.command as u16);
9428 __tmp.put_u8(self.result as u8);
9429 if matches!(version, MavlinkVersion::V2) {
9430 __tmp.put_u8(self.progress);
9431 __tmp.put_i32_le(self.result_param2);
9432 __tmp.put_u8(self.target_system);
9433 __tmp.put_u8(self.target_component);
9434 let len = __tmp.len();
9435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9436 } else {
9437 __tmp.len()
9438 }
9439 }
9440}
9441#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9442#[doc = ""]
9443#[doc = "ID: 80"]
9444#[derive(Debug, Clone, PartialEq)]
9445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9447#[cfg_attr(feature = "ts", derive(TS))]
9448#[cfg_attr(feature = "ts", ts(export))]
9449pub struct COMMAND_CANCEL_DATA {
9450 #[doc = "Command ID (of command to cancel)."]
9451 pub command: MavCmd,
9452 #[doc = "System executing long running command. Should not be broadcast (0)."]
9453 pub target_system: u8,
9454 #[doc = "Component executing long running command."]
9455 pub target_component: u8,
9456}
9457impl COMMAND_CANCEL_DATA {
9458 pub const ENCODED_LEN: usize = 4usize;
9459 pub const DEFAULT: Self = Self {
9460 command: MavCmd::DEFAULT,
9461 target_system: 0_u8,
9462 target_component: 0_u8,
9463 };
9464 #[cfg(feature = "arbitrary")]
9465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9466 use arbitrary::{Arbitrary, Unstructured};
9467 let mut buf = [0u8; 1024];
9468 rng.fill_bytes(&mut buf);
9469 let mut unstructured = Unstructured::new(&buf);
9470 Self::arbitrary(&mut unstructured).unwrap_or_default()
9471 }
9472}
9473impl Default for COMMAND_CANCEL_DATA {
9474 fn default() -> Self {
9475 Self::DEFAULT.clone()
9476 }
9477}
9478impl MessageData for COMMAND_CANCEL_DATA {
9479 type Message = MavMessage;
9480 const ID: u32 = 80u32;
9481 const NAME: &'static str = "COMMAND_CANCEL";
9482 const EXTRA_CRC: u8 = 14u8;
9483 const ENCODED_LEN: usize = 4usize;
9484 fn deser(
9485 _version: MavlinkVersion,
9486 __input: &[u8],
9487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9488 let avail_len = __input.len();
9489 let mut payload_buf = [0; Self::ENCODED_LEN];
9490 let mut buf = if avail_len < Self::ENCODED_LEN {
9491 payload_buf[0..avail_len].copy_from_slice(__input);
9492 Bytes::new(&payload_buf)
9493 } else {
9494 Bytes::new(__input)
9495 };
9496 let mut __struct = Self::default();
9497 let tmp = buf.get_u16_le()?;
9498 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9499 ::mavlink_core::error::ParserError::InvalidEnum {
9500 enum_type: "MavCmd",
9501 value: tmp as u64,
9502 },
9503 )?;
9504 __struct.target_system = buf.get_u8()?;
9505 __struct.target_component = buf.get_u8()?;
9506 Ok(__struct)
9507 }
9508 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9509 let mut __tmp = BytesMut::new(bytes);
9510 #[allow(clippy::absurd_extreme_comparisons)]
9511 #[allow(unused_comparisons)]
9512 if __tmp.remaining() < Self::ENCODED_LEN {
9513 panic!(
9514 "buffer is too small (need {} bytes, but got {})",
9515 Self::ENCODED_LEN,
9516 __tmp.remaining(),
9517 )
9518 }
9519 __tmp.put_u16_le(self.command as u16);
9520 __tmp.put_u8(self.target_system);
9521 __tmp.put_u8(self.target_component);
9522 if matches!(version, MavlinkVersion::V2) {
9523 let len = __tmp.len();
9524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9525 } else {
9526 __tmp.len()
9527 }
9528 }
9529}
9530#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9531#[doc = ""]
9532#[doc = "ID: 75"]
9533#[derive(Debug, Clone, PartialEq)]
9534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9536#[cfg_attr(feature = "ts", derive(TS))]
9537#[cfg_attr(feature = "ts", ts(export))]
9538pub struct COMMAND_INT_DATA {
9539 #[doc = "PARAM1, see MAV_CMD enum"]
9540 pub param1: f32,
9541 #[doc = "PARAM2, see MAV_CMD enum"]
9542 pub param2: f32,
9543 #[doc = "PARAM3, see MAV_CMD enum"]
9544 pub param3: f32,
9545 #[doc = "PARAM4, see MAV_CMD enum"]
9546 pub param4: f32,
9547 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9548 pub x: i32,
9549 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9550 pub y: i32,
9551 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9552 pub z: f32,
9553 #[doc = "The scheduled action for the mission item."]
9554 pub command: MavCmd,
9555 #[doc = "System ID"]
9556 pub target_system: u8,
9557 #[doc = "Component ID"]
9558 pub target_component: u8,
9559 #[doc = "The coordinate system of the COMMAND."]
9560 pub frame: MavFrame,
9561 #[doc = "Not used."]
9562 pub current: u8,
9563 #[doc = "Not used (set 0)."]
9564 pub autocontinue: u8,
9565}
9566impl COMMAND_INT_DATA {
9567 pub const ENCODED_LEN: usize = 35usize;
9568 pub const DEFAULT: Self = Self {
9569 param1: 0.0_f32,
9570 param2: 0.0_f32,
9571 param3: 0.0_f32,
9572 param4: 0.0_f32,
9573 x: 0_i32,
9574 y: 0_i32,
9575 z: 0.0_f32,
9576 command: MavCmd::DEFAULT,
9577 target_system: 0_u8,
9578 target_component: 0_u8,
9579 frame: MavFrame::DEFAULT,
9580 current: 0_u8,
9581 autocontinue: 0_u8,
9582 };
9583 #[cfg(feature = "arbitrary")]
9584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9585 use arbitrary::{Arbitrary, Unstructured};
9586 let mut buf = [0u8; 1024];
9587 rng.fill_bytes(&mut buf);
9588 let mut unstructured = Unstructured::new(&buf);
9589 Self::arbitrary(&mut unstructured).unwrap_or_default()
9590 }
9591}
9592impl Default for COMMAND_INT_DATA {
9593 fn default() -> Self {
9594 Self::DEFAULT.clone()
9595 }
9596}
9597impl MessageData for COMMAND_INT_DATA {
9598 type Message = MavMessage;
9599 const ID: u32 = 75u32;
9600 const NAME: &'static str = "COMMAND_INT";
9601 const EXTRA_CRC: u8 = 158u8;
9602 const ENCODED_LEN: usize = 35usize;
9603 fn deser(
9604 _version: MavlinkVersion,
9605 __input: &[u8],
9606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9607 let avail_len = __input.len();
9608 let mut payload_buf = [0; Self::ENCODED_LEN];
9609 let mut buf = if avail_len < Self::ENCODED_LEN {
9610 payload_buf[0..avail_len].copy_from_slice(__input);
9611 Bytes::new(&payload_buf)
9612 } else {
9613 Bytes::new(__input)
9614 };
9615 let mut __struct = Self::default();
9616 __struct.param1 = buf.get_f32_le()?;
9617 __struct.param2 = buf.get_f32_le()?;
9618 __struct.param3 = buf.get_f32_le()?;
9619 __struct.param4 = buf.get_f32_le()?;
9620 __struct.x = buf.get_i32_le()?;
9621 __struct.y = buf.get_i32_le()?;
9622 __struct.z = buf.get_f32_le()?;
9623 let tmp = buf.get_u16_le()?;
9624 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9625 ::mavlink_core::error::ParserError::InvalidEnum {
9626 enum_type: "MavCmd",
9627 value: tmp as u64,
9628 },
9629 )?;
9630 __struct.target_system = buf.get_u8()?;
9631 __struct.target_component = buf.get_u8()?;
9632 let tmp = buf.get_u8()?;
9633 __struct.frame =
9634 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9635 enum_type: "MavFrame",
9636 value: tmp as u64,
9637 })?;
9638 __struct.current = buf.get_u8()?;
9639 __struct.autocontinue = buf.get_u8()?;
9640 Ok(__struct)
9641 }
9642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9643 let mut __tmp = BytesMut::new(bytes);
9644 #[allow(clippy::absurd_extreme_comparisons)]
9645 #[allow(unused_comparisons)]
9646 if __tmp.remaining() < Self::ENCODED_LEN {
9647 panic!(
9648 "buffer is too small (need {} bytes, but got {})",
9649 Self::ENCODED_LEN,
9650 __tmp.remaining(),
9651 )
9652 }
9653 __tmp.put_f32_le(self.param1);
9654 __tmp.put_f32_le(self.param2);
9655 __tmp.put_f32_le(self.param3);
9656 __tmp.put_f32_le(self.param4);
9657 __tmp.put_i32_le(self.x);
9658 __tmp.put_i32_le(self.y);
9659 __tmp.put_f32_le(self.z);
9660 __tmp.put_u16_le(self.command as u16);
9661 __tmp.put_u8(self.target_system);
9662 __tmp.put_u8(self.target_component);
9663 __tmp.put_u8(self.frame as u8);
9664 __tmp.put_u8(self.current);
9665 __tmp.put_u8(self.autocontinue);
9666 if matches!(version, MavlinkVersion::V2) {
9667 let len = __tmp.len();
9668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9669 } else {
9670 __tmp.len()
9671 }
9672 }
9673}
9674#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9675#[doc = ""]
9676#[doc = "ID: 76"]
9677#[derive(Debug, Clone, PartialEq)]
9678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9680#[cfg_attr(feature = "ts", derive(TS))]
9681#[cfg_attr(feature = "ts", ts(export))]
9682pub struct COMMAND_LONG_DATA {
9683 #[doc = "Parameter 1 (for the specific command)."]
9684 pub param1: f32,
9685 #[doc = "Parameter 2 (for the specific command)."]
9686 pub param2: f32,
9687 #[doc = "Parameter 3 (for the specific command)."]
9688 pub param3: f32,
9689 #[doc = "Parameter 4 (for the specific command)."]
9690 pub param4: f32,
9691 #[doc = "Parameter 5 (for the specific command)."]
9692 pub param5: f32,
9693 #[doc = "Parameter 6 (for the specific command)."]
9694 pub param6: f32,
9695 #[doc = "Parameter 7 (for the specific command)."]
9696 pub param7: f32,
9697 #[doc = "Command ID (of command to send)."]
9698 pub command: MavCmd,
9699 #[doc = "System which should execute the command"]
9700 pub target_system: u8,
9701 #[doc = "Component which should execute the command, 0 for all components"]
9702 pub target_component: u8,
9703 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9704 pub confirmation: u8,
9705}
9706impl COMMAND_LONG_DATA {
9707 pub const ENCODED_LEN: usize = 33usize;
9708 pub const DEFAULT: Self = Self {
9709 param1: 0.0_f32,
9710 param2: 0.0_f32,
9711 param3: 0.0_f32,
9712 param4: 0.0_f32,
9713 param5: 0.0_f32,
9714 param6: 0.0_f32,
9715 param7: 0.0_f32,
9716 command: MavCmd::DEFAULT,
9717 target_system: 0_u8,
9718 target_component: 0_u8,
9719 confirmation: 0_u8,
9720 };
9721 #[cfg(feature = "arbitrary")]
9722 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9723 use arbitrary::{Arbitrary, Unstructured};
9724 let mut buf = [0u8; 1024];
9725 rng.fill_bytes(&mut buf);
9726 let mut unstructured = Unstructured::new(&buf);
9727 Self::arbitrary(&mut unstructured).unwrap_or_default()
9728 }
9729}
9730impl Default for COMMAND_LONG_DATA {
9731 fn default() -> Self {
9732 Self::DEFAULT.clone()
9733 }
9734}
9735impl MessageData for COMMAND_LONG_DATA {
9736 type Message = MavMessage;
9737 const ID: u32 = 76u32;
9738 const NAME: &'static str = "COMMAND_LONG";
9739 const EXTRA_CRC: u8 = 152u8;
9740 const ENCODED_LEN: usize = 33usize;
9741 fn deser(
9742 _version: MavlinkVersion,
9743 __input: &[u8],
9744 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9745 let avail_len = __input.len();
9746 let mut payload_buf = [0; Self::ENCODED_LEN];
9747 let mut buf = if avail_len < Self::ENCODED_LEN {
9748 payload_buf[0..avail_len].copy_from_slice(__input);
9749 Bytes::new(&payload_buf)
9750 } else {
9751 Bytes::new(__input)
9752 };
9753 let mut __struct = Self::default();
9754 __struct.param1 = buf.get_f32_le()?;
9755 __struct.param2 = buf.get_f32_le()?;
9756 __struct.param3 = buf.get_f32_le()?;
9757 __struct.param4 = buf.get_f32_le()?;
9758 __struct.param5 = buf.get_f32_le()?;
9759 __struct.param6 = buf.get_f32_le()?;
9760 __struct.param7 = buf.get_f32_le()?;
9761 let tmp = buf.get_u16_le()?;
9762 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9763 ::mavlink_core::error::ParserError::InvalidEnum {
9764 enum_type: "MavCmd",
9765 value: tmp as u64,
9766 },
9767 )?;
9768 __struct.target_system = buf.get_u8()?;
9769 __struct.target_component = buf.get_u8()?;
9770 __struct.confirmation = buf.get_u8()?;
9771 Ok(__struct)
9772 }
9773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9774 let mut __tmp = BytesMut::new(bytes);
9775 #[allow(clippy::absurd_extreme_comparisons)]
9776 #[allow(unused_comparisons)]
9777 if __tmp.remaining() < Self::ENCODED_LEN {
9778 panic!(
9779 "buffer is too small (need {} bytes, but got {})",
9780 Self::ENCODED_LEN,
9781 __tmp.remaining(),
9782 )
9783 }
9784 __tmp.put_f32_le(self.param1);
9785 __tmp.put_f32_le(self.param2);
9786 __tmp.put_f32_le(self.param3);
9787 __tmp.put_f32_le(self.param4);
9788 __tmp.put_f32_le(self.param5);
9789 __tmp.put_f32_le(self.param6);
9790 __tmp.put_f32_le(self.param7);
9791 __tmp.put_u16_le(self.command as u16);
9792 __tmp.put_u8(self.target_system);
9793 __tmp.put_u8(self.target_component);
9794 __tmp.put_u8(self.confirmation);
9795 if matches!(version, MavlinkVersion::V2) {
9796 let len = __tmp.len();
9797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9798 } else {
9799 __tmp.len()
9800 }
9801 }
9802}
9803#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9804#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9805#[doc = ""]
9806#[doc = "ID: 395"]
9807#[derive(Debug, Clone, PartialEq)]
9808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9810#[cfg_attr(feature = "ts", derive(TS))]
9811#[cfg_attr(feature = "ts", ts(export))]
9812pub struct COMPONENT_INFORMATION_DATA {
9813 #[doc = "Timestamp (time since system boot)."]
9814 pub time_boot_ms: u32,
9815 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9816 pub general_metadata_file_crc: u32,
9817 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9818 pub peripherals_metadata_file_crc: u32,
9819 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9820 #[cfg_attr(feature = "ts", ts(type = "string"))]
9821 pub general_metadata_uri: CharArray<100>,
9822 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9823 #[cfg_attr(feature = "ts", ts(type = "string"))]
9824 pub peripherals_metadata_uri: CharArray<100>,
9825}
9826impl COMPONENT_INFORMATION_DATA {
9827 pub const ENCODED_LEN: usize = 212usize;
9828 pub const DEFAULT: Self = Self {
9829 time_boot_ms: 0_u32,
9830 general_metadata_file_crc: 0_u32,
9831 peripherals_metadata_file_crc: 0_u32,
9832 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9833 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9834 };
9835 #[cfg(feature = "arbitrary")]
9836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9837 use arbitrary::{Arbitrary, Unstructured};
9838 let mut buf = [0u8; 1024];
9839 rng.fill_bytes(&mut buf);
9840 let mut unstructured = Unstructured::new(&buf);
9841 Self::arbitrary(&mut unstructured).unwrap_or_default()
9842 }
9843}
9844impl Default for COMPONENT_INFORMATION_DATA {
9845 fn default() -> Self {
9846 Self::DEFAULT.clone()
9847 }
9848}
9849impl MessageData for COMPONENT_INFORMATION_DATA {
9850 type Message = MavMessage;
9851 const ID: u32 = 395u32;
9852 const NAME: &'static str = "COMPONENT_INFORMATION";
9853 const EXTRA_CRC: u8 = 0u8;
9854 const ENCODED_LEN: usize = 212usize;
9855 fn deser(
9856 _version: MavlinkVersion,
9857 __input: &[u8],
9858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9859 let avail_len = __input.len();
9860 let mut payload_buf = [0; Self::ENCODED_LEN];
9861 let mut buf = if avail_len < Self::ENCODED_LEN {
9862 payload_buf[0..avail_len].copy_from_slice(__input);
9863 Bytes::new(&payload_buf)
9864 } else {
9865 Bytes::new(__input)
9866 };
9867 let mut __struct = Self::default();
9868 __struct.time_boot_ms = buf.get_u32_le()?;
9869 __struct.general_metadata_file_crc = buf.get_u32_le()?;
9870 __struct.peripherals_metadata_file_crc = buf.get_u32_le()?;
9871 let mut tmp = [0_u8; 100usize];
9872 for v in &mut tmp {
9873 *v = buf.get_u8()?;
9874 }
9875 __struct.general_metadata_uri = CharArray::new(tmp);
9876 let mut tmp = [0_u8; 100usize];
9877 for v in &mut tmp {
9878 *v = buf.get_u8()?;
9879 }
9880 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9881 Ok(__struct)
9882 }
9883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9884 let mut __tmp = BytesMut::new(bytes);
9885 #[allow(clippy::absurd_extreme_comparisons)]
9886 #[allow(unused_comparisons)]
9887 if __tmp.remaining() < Self::ENCODED_LEN {
9888 panic!(
9889 "buffer is too small (need {} bytes, but got {})",
9890 Self::ENCODED_LEN,
9891 __tmp.remaining(),
9892 )
9893 }
9894 __tmp.put_u32_le(self.time_boot_ms);
9895 __tmp.put_u32_le(self.general_metadata_file_crc);
9896 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9897 for val in &self.general_metadata_uri {
9898 __tmp.put_u8(*val);
9899 }
9900 for val in &self.peripherals_metadata_uri {
9901 __tmp.put_u8(*val);
9902 }
9903 if matches!(version, MavlinkVersion::V2) {
9904 let len = __tmp.len();
9905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9906 } else {
9907 __tmp.len()
9908 }
9909 }
9910}
9911#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9912#[doc = ""]
9913#[doc = "ID: 396"]
9914#[derive(Debug, Clone, PartialEq)]
9915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9917#[cfg_attr(feature = "ts", derive(TS))]
9918#[cfg_attr(feature = "ts", ts(export))]
9919pub struct COMPONENT_INFORMATION_BASIC_DATA {
9920 #[doc = "Component capability flags"]
9921 pub capabilities: MavProtocolCapability,
9922 #[doc = "Timestamp (time since system boot)."]
9923 pub time_boot_ms: u32,
9924 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9925 pub time_manufacture_s: u32,
9926 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9927 #[cfg_attr(feature = "ts", ts(type = "string"))]
9928 pub vendor_name: CharArray<32>,
9929 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9930 #[cfg_attr(feature = "ts", ts(type = "string"))]
9931 pub model_name: CharArray<32>,
9932 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9933 #[cfg_attr(feature = "ts", ts(type = "string"))]
9934 pub software_version: CharArray<24>,
9935 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9936 #[cfg_attr(feature = "ts", ts(type = "string"))]
9937 pub hardware_version: CharArray<24>,
9938 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9939 #[cfg_attr(feature = "ts", ts(type = "string"))]
9940 pub serial_number: CharArray<32>,
9941}
9942impl COMPONENT_INFORMATION_BASIC_DATA {
9943 pub const ENCODED_LEN: usize = 160usize;
9944 pub const DEFAULT: Self = Self {
9945 capabilities: MavProtocolCapability::DEFAULT,
9946 time_boot_ms: 0_u32,
9947 time_manufacture_s: 0_u32,
9948 vendor_name: CharArray::new([0_u8; 32usize]),
9949 model_name: CharArray::new([0_u8; 32usize]),
9950 software_version: CharArray::new([0_u8; 24usize]),
9951 hardware_version: CharArray::new([0_u8; 24usize]),
9952 serial_number: CharArray::new([0_u8; 32usize]),
9953 };
9954 #[cfg(feature = "arbitrary")]
9955 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9956 use arbitrary::{Arbitrary, Unstructured};
9957 let mut buf = [0u8; 1024];
9958 rng.fill_bytes(&mut buf);
9959 let mut unstructured = Unstructured::new(&buf);
9960 Self::arbitrary(&mut unstructured).unwrap_or_default()
9961 }
9962}
9963impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9964 fn default() -> Self {
9965 Self::DEFAULT.clone()
9966 }
9967}
9968impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9969 type Message = MavMessage;
9970 const ID: u32 = 396u32;
9971 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9972 const EXTRA_CRC: u8 = 50u8;
9973 const ENCODED_LEN: usize = 160usize;
9974 fn deser(
9975 _version: MavlinkVersion,
9976 __input: &[u8],
9977 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9978 let avail_len = __input.len();
9979 let mut payload_buf = [0; Self::ENCODED_LEN];
9980 let mut buf = if avail_len < Self::ENCODED_LEN {
9981 payload_buf[0..avail_len].copy_from_slice(__input);
9982 Bytes::new(&payload_buf)
9983 } else {
9984 Bytes::new(__input)
9985 };
9986 let mut __struct = Self::default();
9987 let tmp = buf.get_u64_le()?;
9988 __struct.capabilities = MavProtocolCapability::from_bits(
9989 tmp as <MavProtocolCapability as Flags>::Bits,
9990 )
9991 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9992 flag_type: "MavProtocolCapability",
9993 value: tmp as u64,
9994 })?;
9995 __struct.time_boot_ms = buf.get_u32_le()?;
9996 __struct.time_manufacture_s = buf.get_u32_le()?;
9997 let mut tmp = [0_u8; 32usize];
9998 for v in &mut tmp {
9999 *v = buf.get_u8()?;
10000 }
10001 __struct.vendor_name = CharArray::new(tmp);
10002 let mut tmp = [0_u8; 32usize];
10003 for v in &mut tmp {
10004 *v = buf.get_u8()?;
10005 }
10006 __struct.model_name = CharArray::new(tmp);
10007 let mut tmp = [0_u8; 24usize];
10008 for v in &mut tmp {
10009 *v = buf.get_u8()?;
10010 }
10011 __struct.software_version = CharArray::new(tmp);
10012 let mut tmp = [0_u8; 24usize];
10013 for v in &mut tmp {
10014 *v = buf.get_u8()?;
10015 }
10016 __struct.hardware_version = CharArray::new(tmp);
10017 let mut tmp = [0_u8; 32usize];
10018 for v in &mut tmp {
10019 *v = buf.get_u8()?;
10020 }
10021 __struct.serial_number = CharArray::new(tmp);
10022 Ok(__struct)
10023 }
10024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10025 let mut __tmp = BytesMut::new(bytes);
10026 #[allow(clippy::absurd_extreme_comparisons)]
10027 #[allow(unused_comparisons)]
10028 if __tmp.remaining() < Self::ENCODED_LEN {
10029 panic!(
10030 "buffer is too small (need {} bytes, but got {})",
10031 Self::ENCODED_LEN,
10032 __tmp.remaining(),
10033 )
10034 }
10035 __tmp.put_u64_le(self.capabilities.bits() as u64);
10036 __tmp.put_u32_le(self.time_boot_ms);
10037 __tmp.put_u32_le(self.time_manufacture_s);
10038 for val in &self.vendor_name {
10039 __tmp.put_u8(*val);
10040 }
10041 for val in &self.model_name {
10042 __tmp.put_u8(*val);
10043 }
10044 for val in &self.software_version {
10045 __tmp.put_u8(*val);
10046 }
10047 for val in &self.hardware_version {
10048 __tmp.put_u8(*val);
10049 }
10050 for val in &self.serial_number {
10051 __tmp.put_u8(*val);
10052 }
10053 if matches!(version, MavlinkVersion::V2) {
10054 let len = __tmp.len();
10055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10056 } else {
10057 __tmp.len()
10058 }
10059 }
10060}
10061#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10062#[doc = ""]
10063#[doc = "ID: 397"]
10064#[derive(Debug, Clone, PartialEq)]
10065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10067#[cfg_attr(feature = "ts", derive(TS))]
10068#[cfg_attr(feature = "ts", ts(export))]
10069pub struct COMPONENT_METADATA_DATA {
10070 #[doc = "Timestamp (time since system boot)."]
10071 pub time_boot_ms: u32,
10072 #[doc = "CRC32 of the general metadata file."]
10073 pub file_crc: u32,
10074 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10075 #[cfg_attr(feature = "ts", ts(type = "string"))]
10076 pub uri: CharArray<100>,
10077}
10078impl COMPONENT_METADATA_DATA {
10079 pub const ENCODED_LEN: usize = 108usize;
10080 pub const DEFAULT: Self = Self {
10081 time_boot_ms: 0_u32,
10082 file_crc: 0_u32,
10083 uri: CharArray::new([0_u8; 100usize]),
10084 };
10085 #[cfg(feature = "arbitrary")]
10086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10087 use arbitrary::{Arbitrary, Unstructured};
10088 let mut buf = [0u8; 1024];
10089 rng.fill_bytes(&mut buf);
10090 let mut unstructured = Unstructured::new(&buf);
10091 Self::arbitrary(&mut unstructured).unwrap_or_default()
10092 }
10093}
10094impl Default for COMPONENT_METADATA_DATA {
10095 fn default() -> Self {
10096 Self::DEFAULT.clone()
10097 }
10098}
10099impl MessageData for COMPONENT_METADATA_DATA {
10100 type Message = MavMessage;
10101 const ID: u32 = 397u32;
10102 const NAME: &'static str = "COMPONENT_METADATA";
10103 const EXTRA_CRC: u8 = 182u8;
10104 const ENCODED_LEN: usize = 108usize;
10105 fn deser(
10106 _version: MavlinkVersion,
10107 __input: &[u8],
10108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10109 let avail_len = __input.len();
10110 let mut payload_buf = [0; Self::ENCODED_LEN];
10111 let mut buf = if avail_len < Self::ENCODED_LEN {
10112 payload_buf[0..avail_len].copy_from_slice(__input);
10113 Bytes::new(&payload_buf)
10114 } else {
10115 Bytes::new(__input)
10116 };
10117 let mut __struct = Self::default();
10118 __struct.time_boot_ms = buf.get_u32_le()?;
10119 __struct.file_crc = buf.get_u32_le()?;
10120 let mut tmp = [0_u8; 100usize];
10121 for v in &mut tmp {
10122 *v = buf.get_u8()?;
10123 }
10124 __struct.uri = CharArray::new(tmp);
10125 Ok(__struct)
10126 }
10127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10128 let mut __tmp = BytesMut::new(bytes);
10129 #[allow(clippy::absurd_extreme_comparisons)]
10130 #[allow(unused_comparisons)]
10131 if __tmp.remaining() < Self::ENCODED_LEN {
10132 panic!(
10133 "buffer is too small (need {} bytes, but got {})",
10134 Self::ENCODED_LEN,
10135 __tmp.remaining(),
10136 )
10137 }
10138 __tmp.put_u32_le(self.time_boot_ms);
10139 __tmp.put_u32_le(self.file_crc);
10140 for val in &self.uri {
10141 __tmp.put_u8(*val);
10142 }
10143 if matches!(version, MavlinkVersion::V2) {
10144 let len = __tmp.len();
10145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10146 } else {
10147 __tmp.len()
10148 }
10149 }
10150}
10151#[doc = "Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL."]
10152#[doc = ""]
10153#[doc = "ID: 512"]
10154#[derive(Debug, Clone, PartialEq)]
10155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10157#[cfg_attr(feature = "ts", derive(TS))]
10158#[cfg_attr(feature = "ts", ts(export))]
10159pub struct CONTROL_STATUS_DATA {
10160 #[doc = "System ID of GCS MAVLink component in control (0: no GCS in control)."]
10161 pub sysid_in_control: u8,
10162 #[doc = "Control status. For example, whether takeover is allowed, and whether this message instance defines the default controlling GCS for the whole system."]
10163 pub flags: GcsControlStatusFlags,
10164}
10165impl CONTROL_STATUS_DATA {
10166 pub const ENCODED_LEN: usize = 2usize;
10167 pub const DEFAULT: Self = Self {
10168 sysid_in_control: 0_u8,
10169 flags: GcsControlStatusFlags::DEFAULT,
10170 };
10171 #[cfg(feature = "arbitrary")]
10172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10173 use arbitrary::{Arbitrary, Unstructured};
10174 let mut buf = [0u8; 1024];
10175 rng.fill_bytes(&mut buf);
10176 let mut unstructured = Unstructured::new(&buf);
10177 Self::arbitrary(&mut unstructured).unwrap_or_default()
10178 }
10179}
10180impl Default for CONTROL_STATUS_DATA {
10181 fn default() -> Self {
10182 Self::DEFAULT.clone()
10183 }
10184}
10185impl MessageData for CONTROL_STATUS_DATA {
10186 type Message = MavMessage;
10187 const ID: u32 = 512u32;
10188 const NAME: &'static str = "CONTROL_STATUS";
10189 const EXTRA_CRC: u8 = 184u8;
10190 const ENCODED_LEN: usize = 2usize;
10191 fn deser(
10192 _version: MavlinkVersion,
10193 __input: &[u8],
10194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10195 let avail_len = __input.len();
10196 let mut payload_buf = [0; Self::ENCODED_LEN];
10197 let mut buf = if avail_len < Self::ENCODED_LEN {
10198 payload_buf[0..avail_len].copy_from_slice(__input);
10199 Bytes::new(&payload_buf)
10200 } else {
10201 Bytes::new(__input)
10202 };
10203 let mut __struct = Self::default();
10204 __struct.sysid_in_control = buf.get_u8()?;
10205 let tmp = buf.get_u8()?;
10206 __struct.flags = GcsControlStatusFlags::from_bits(
10207 tmp as <GcsControlStatusFlags as Flags>::Bits,
10208 )
10209 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10210 flag_type: "GcsControlStatusFlags",
10211 value: tmp as u64,
10212 })?;
10213 Ok(__struct)
10214 }
10215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10216 let mut __tmp = BytesMut::new(bytes);
10217 #[allow(clippy::absurd_extreme_comparisons)]
10218 #[allow(unused_comparisons)]
10219 if __tmp.remaining() < Self::ENCODED_LEN {
10220 panic!(
10221 "buffer is too small (need {} bytes, but got {})",
10222 Self::ENCODED_LEN,
10223 __tmp.remaining(),
10224 )
10225 }
10226 __tmp.put_u8(self.sysid_in_control);
10227 __tmp.put_u8(self.flags.bits() as u8);
10228 if matches!(version, MavlinkVersion::V2) {
10229 let len = __tmp.len();
10230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10231 } else {
10232 __tmp.len()
10233 }
10234 }
10235}
10236#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10237#[doc = ""]
10238#[doc = "ID: 146"]
10239#[derive(Debug, Clone, PartialEq)]
10240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10242#[cfg_attr(feature = "ts", derive(TS))]
10243#[cfg_attr(feature = "ts", ts(export))]
10244pub struct CONTROL_SYSTEM_STATE_DATA {
10245 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10246 pub time_usec: u64,
10247 #[doc = "X acceleration in body frame"]
10248 pub x_acc: f32,
10249 #[doc = "Y acceleration in body frame"]
10250 pub y_acc: f32,
10251 #[doc = "Z acceleration in body frame"]
10252 pub z_acc: f32,
10253 #[doc = "X velocity in body frame"]
10254 pub x_vel: f32,
10255 #[doc = "Y velocity in body frame"]
10256 pub y_vel: f32,
10257 #[doc = "Z velocity in body frame"]
10258 pub z_vel: f32,
10259 #[doc = "X position in local frame"]
10260 pub x_pos: f32,
10261 #[doc = "Y position in local frame"]
10262 pub y_pos: f32,
10263 #[doc = "Z position in local frame"]
10264 pub z_pos: f32,
10265 #[doc = "Airspeed, set to -1 if unknown"]
10266 pub airspeed: f32,
10267 #[doc = "Variance of body velocity estimate"]
10268 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10269 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10270 pub vel_variance: [f32; 3],
10271 #[doc = "Variance in local position"]
10272 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10273 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10274 pub pos_variance: [f32; 3],
10275 #[doc = "The attitude, represented as Quaternion"]
10276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10277 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10278 pub q: [f32; 4],
10279 #[doc = "Angular rate in roll axis"]
10280 pub roll_rate: f32,
10281 #[doc = "Angular rate in pitch axis"]
10282 pub pitch_rate: f32,
10283 #[doc = "Angular rate in yaw axis"]
10284 pub yaw_rate: f32,
10285}
10286impl CONTROL_SYSTEM_STATE_DATA {
10287 pub const ENCODED_LEN: usize = 100usize;
10288 pub const DEFAULT: Self = Self {
10289 time_usec: 0_u64,
10290 x_acc: 0.0_f32,
10291 y_acc: 0.0_f32,
10292 z_acc: 0.0_f32,
10293 x_vel: 0.0_f32,
10294 y_vel: 0.0_f32,
10295 z_vel: 0.0_f32,
10296 x_pos: 0.0_f32,
10297 y_pos: 0.0_f32,
10298 z_pos: 0.0_f32,
10299 airspeed: 0.0_f32,
10300 vel_variance: [0.0_f32; 3usize],
10301 pos_variance: [0.0_f32; 3usize],
10302 q: [0.0_f32; 4usize],
10303 roll_rate: 0.0_f32,
10304 pitch_rate: 0.0_f32,
10305 yaw_rate: 0.0_f32,
10306 };
10307 #[cfg(feature = "arbitrary")]
10308 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10309 use arbitrary::{Arbitrary, Unstructured};
10310 let mut buf = [0u8; 1024];
10311 rng.fill_bytes(&mut buf);
10312 let mut unstructured = Unstructured::new(&buf);
10313 Self::arbitrary(&mut unstructured).unwrap_or_default()
10314 }
10315}
10316impl Default for CONTROL_SYSTEM_STATE_DATA {
10317 fn default() -> Self {
10318 Self::DEFAULT.clone()
10319 }
10320}
10321impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10322 type Message = MavMessage;
10323 const ID: u32 = 146u32;
10324 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10325 const EXTRA_CRC: u8 = 103u8;
10326 const ENCODED_LEN: usize = 100usize;
10327 fn deser(
10328 _version: MavlinkVersion,
10329 __input: &[u8],
10330 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10331 let avail_len = __input.len();
10332 let mut payload_buf = [0; Self::ENCODED_LEN];
10333 let mut buf = if avail_len < Self::ENCODED_LEN {
10334 payload_buf[0..avail_len].copy_from_slice(__input);
10335 Bytes::new(&payload_buf)
10336 } else {
10337 Bytes::new(__input)
10338 };
10339 let mut __struct = Self::default();
10340 __struct.time_usec = buf.get_u64_le()?;
10341 __struct.x_acc = buf.get_f32_le()?;
10342 __struct.y_acc = buf.get_f32_le()?;
10343 __struct.z_acc = buf.get_f32_le()?;
10344 __struct.x_vel = buf.get_f32_le()?;
10345 __struct.y_vel = buf.get_f32_le()?;
10346 __struct.z_vel = buf.get_f32_le()?;
10347 __struct.x_pos = buf.get_f32_le()?;
10348 __struct.y_pos = buf.get_f32_le()?;
10349 __struct.z_pos = buf.get_f32_le()?;
10350 __struct.airspeed = buf.get_f32_le()?;
10351 for v in &mut __struct.vel_variance {
10352 let val = buf.get_f32_le()?;
10353 *v = val;
10354 }
10355 for v in &mut __struct.pos_variance {
10356 let val = buf.get_f32_le()?;
10357 *v = val;
10358 }
10359 for v in &mut __struct.q {
10360 let val = buf.get_f32_le()?;
10361 *v = val;
10362 }
10363 __struct.roll_rate = buf.get_f32_le()?;
10364 __struct.pitch_rate = buf.get_f32_le()?;
10365 __struct.yaw_rate = buf.get_f32_le()?;
10366 Ok(__struct)
10367 }
10368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10369 let mut __tmp = BytesMut::new(bytes);
10370 #[allow(clippy::absurd_extreme_comparisons)]
10371 #[allow(unused_comparisons)]
10372 if __tmp.remaining() < Self::ENCODED_LEN {
10373 panic!(
10374 "buffer is too small (need {} bytes, but got {})",
10375 Self::ENCODED_LEN,
10376 __tmp.remaining(),
10377 )
10378 }
10379 __tmp.put_u64_le(self.time_usec);
10380 __tmp.put_f32_le(self.x_acc);
10381 __tmp.put_f32_le(self.y_acc);
10382 __tmp.put_f32_le(self.z_acc);
10383 __tmp.put_f32_le(self.x_vel);
10384 __tmp.put_f32_le(self.y_vel);
10385 __tmp.put_f32_le(self.z_vel);
10386 __tmp.put_f32_le(self.x_pos);
10387 __tmp.put_f32_le(self.y_pos);
10388 __tmp.put_f32_le(self.z_pos);
10389 __tmp.put_f32_le(self.airspeed);
10390 for val in &self.vel_variance {
10391 __tmp.put_f32_le(*val);
10392 }
10393 for val in &self.pos_variance {
10394 __tmp.put_f32_le(*val);
10395 }
10396 for val in &self.q {
10397 __tmp.put_f32_le(*val);
10398 }
10399 __tmp.put_f32_le(self.roll_rate);
10400 __tmp.put_f32_le(self.pitch_rate);
10401 __tmp.put_f32_le(self.yaw_rate);
10402 if matches!(version, MavlinkVersion::V2) {
10403 let len = __tmp.len();
10404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10405 } else {
10406 __tmp.len()
10407 }
10408 }
10409}
10410#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10411#[doc = ""]
10412#[doc = "ID: 411"]
10413#[derive(Debug, Clone, PartialEq)]
10414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10416#[cfg_attr(feature = "ts", derive(TS))]
10417#[cfg_attr(feature = "ts", ts(export))]
10418pub struct CURRENT_EVENT_SEQUENCE_DATA {
10419 #[doc = "Sequence number."]
10420 pub sequence: u16,
10421 #[doc = "Flag bitset."]
10422 pub flags: MavEventCurrentSequenceFlags,
10423}
10424impl CURRENT_EVENT_SEQUENCE_DATA {
10425 pub const ENCODED_LEN: usize = 3usize;
10426 pub const DEFAULT: Self = Self {
10427 sequence: 0_u16,
10428 flags: MavEventCurrentSequenceFlags::DEFAULT,
10429 };
10430 #[cfg(feature = "arbitrary")]
10431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10432 use arbitrary::{Arbitrary, Unstructured};
10433 let mut buf = [0u8; 1024];
10434 rng.fill_bytes(&mut buf);
10435 let mut unstructured = Unstructured::new(&buf);
10436 Self::arbitrary(&mut unstructured).unwrap_or_default()
10437 }
10438}
10439impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10440 fn default() -> Self {
10441 Self::DEFAULT.clone()
10442 }
10443}
10444impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10445 type Message = MavMessage;
10446 const ID: u32 = 411u32;
10447 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10448 const EXTRA_CRC: u8 = 106u8;
10449 const ENCODED_LEN: usize = 3usize;
10450 fn deser(
10451 _version: MavlinkVersion,
10452 __input: &[u8],
10453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10454 let avail_len = __input.len();
10455 let mut payload_buf = [0; Self::ENCODED_LEN];
10456 let mut buf = if avail_len < Self::ENCODED_LEN {
10457 payload_buf[0..avail_len].copy_from_slice(__input);
10458 Bytes::new(&payload_buf)
10459 } else {
10460 Bytes::new(__input)
10461 };
10462 let mut __struct = Self::default();
10463 __struct.sequence = buf.get_u16_le()?;
10464 let tmp = buf.get_u8()?;
10465 __struct.flags =
10466 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10467 enum_type: "MavEventCurrentSequenceFlags",
10468 value: tmp as u64,
10469 })?;
10470 Ok(__struct)
10471 }
10472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10473 let mut __tmp = BytesMut::new(bytes);
10474 #[allow(clippy::absurd_extreme_comparisons)]
10475 #[allow(unused_comparisons)]
10476 if __tmp.remaining() < Self::ENCODED_LEN {
10477 panic!(
10478 "buffer is too small (need {} bytes, but got {})",
10479 Self::ENCODED_LEN,
10480 __tmp.remaining(),
10481 )
10482 }
10483 __tmp.put_u16_le(self.sequence);
10484 __tmp.put_u8(self.flags as u8);
10485 if matches!(version, MavlinkVersion::V2) {
10486 let len = __tmp.len();
10487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10488 } else {
10489 __tmp.len()
10490 }
10491 }
10492}
10493#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10494#[doc = ""]
10495#[doc = "ID: 436"]
10496#[derive(Debug, Clone, PartialEq)]
10497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10499#[cfg_attr(feature = "ts", derive(TS))]
10500#[cfg_attr(feature = "ts", ts(export))]
10501pub struct CURRENT_MODE_DATA {
10502 #[doc = "A bitfield for use for autopilot-specific flags"]
10503 pub custom_mode: u32,
10504 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10505 pub intended_custom_mode: u32,
10506 #[doc = "Standard mode."]
10507 pub standard_mode: MavStandardMode,
10508}
10509impl CURRENT_MODE_DATA {
10510 pub const ENCODED_LEN: usize = 9usize;
10511 pub const DEFAULT: Self = Self {
10512 custom_mode: 0_u32,
10513 intended_custom_mode: 0_u32,
10514 standard_mode: MavStandardMode::DEFAULT,
10515 };
10516 #[cfg(feature = "arbitrary")]
10517 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10518 use arbitrary::{Arbitrary, Unstructured};
10519 let mut buf = [0u8; 1024];
10520 rng.fill_bytes(&mut buf);
10521 let mut unstructured = Unstructured::new(&buf);
10522 Self::arbitrary(&mut unstructured).unwrap_or_default()
10523 }
10524}
10525impl Default for CURRENT_MODE_DATA {
10526 fn default() -> Self {
10527 Self::DEFAULT.clone()
10528 }
10529}
10530impl MessageData for CURRENT_MODE_DATA {
10531 type Message = MavMessage;
10532 const ID: u32 = 436u32;
10533 const NAME: &'static str = "CURRENT_MODE";
10534 const EXTRA_CRC: u8 = 193u8;
10535 const ENCODED_LEN: usize = 9usize;
10536 fn deser(
10537 _version: MavlinkVersion,
10538 __input: &[u8],
10539 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10540 let avail_len = __input.len();
10541 let mut payload_buf = [0; Self::ENCODED_LEN];
10542 let mut buf = if avail_len < Self::ENCODED_LEN {
10543 payload_buf[0..avail_len].copy_from_slice(__input);
10544 Bytes::new(&payload_buf)
10545 } else {
10546 Bytes::new(__input)
10547 };
10548 let mut __struct = Self::default();
10549 __struct.custom_mode = buf.get_u32_le()?;
10550 __struct.intended_custom_mode = buf.get_u32_le()?;
10551 let tmp = buf.get_u8()?;
10552 __struct.standard_mode =
10553 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10554 enum_type: "MavStandardMode",
10555 value: tmp as u64,
10556 })?;
10557 Ok(__struct)
10558 }
10559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10560 let mut __tmp = BytesMut::new(bytes);
10561 #[allow(clippy::absurd_extreme_comparisons)]
10562 #[allow(unused_comparisons)]
10563 if __tmp.remaining() < Self::ENCODED_LEN {
10564 panic!(
10565 "buffer is too small (need {} bytes, but got {})",
10566 Self::ENCODED_LEN,
10567 __tmp.remaining(),
10568 )
10569 }
10570 __tmp.put_u32_le(self.custom_mode);
10571 __tmp.put_u32_le(self.intended_custom_mode);
10572 __tmp.put_u8(self.standard_mode as u8);
10573 if matches!(version, MavlinkVersion::V2) {
10574 let len = __tmp.len();
10575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10576 } else {
10577 __tmp.len()
10578 }
10579 }
10580}
10581#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10582#[doc = "Data stream status information."]
10583#[doc = ""]
10584#[doc = "ID: 67"]
10585#[derive(Debug, Clone, PartialEq)]
10586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10588#[cfg_attr(feature = "ts", derive(TS))]
10589#[cfg_attr(feature = "ts", ts(export))]
10590pub struct DATA_STREAM_DATA {
10591 #[doc = "The message rate"]
10592 pub message_rate: u16,
10593 #[doc = "The ID of the requested data stream"]
10594 pub stream_id: u8,
10595 #[doc = "1 stream is enabled, 0 stream is stopped."]
10596 pub on_off: u8,
10597}
10598impl DATA_STREAM_DATA {
10599 pub const ENCODED_LEN: usize = 4usize;
10600 pub const DEFAULT: Self = Self {
10601 message_rate: 0_u16,
10602 stream_id: 0_u8,
10603 on_off: 0_u8,
10604 };
10605 #[cfg(feature = "arbitrary")]
10606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10607 use arbitrary::{Arbitrary, Unstructured};
10608 let mut buf = [0u8; 1024];
10609 rng.fill_bytes(&mut buf);
10610 let mut unstructured = Unstructured::new(&buf);
10611 Self::arbitrary(&mut unstructured).unwrap_or_default()
10612 }
10613}
10614impl Default for DATA_STREAM_DATA {
10615 fn default() -> Self {
10616 Self::DEFAULT.clone()
10617 }
10618}
10619impl MessageData for DATA_STREAM_DATA {
10620 type Message = MavMessage;
10621 const ID: u32 = 67u32;
10622 const NAME: &'static str = "DATA_STREAM";
10623 const EXTRA_CRC: u8 = 21u8;
10624 const ENCODED_LEN: usize = 4usize;
10625 fn deser(
10626 _version: MavlinkVersion,
10627 __input: &[u8],
10628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10629 let avail_len = __input.len();
10630 let mut payload_buf = [0; Self::ENCODED_LEN];
10631 let mut buf = if avail_len < Self::ENCODED_LEN {
10632 payload_buf[0..avail_len].copy_from_slice(__input);
10633 Bytes::new(&payload_buf)
10634 } else {
10635 Bytes::new(__input)
10636 };
10637 let mut __struct = Self::default();
10638 __struct.message_rate = buf.get_u16_le()?;
10639 __struct.stream_id = buf.get_u8()?;
10640 __struct.on_off = buf.get_u8()?;
10641 Ok(__struct)
10642 }
10643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10644 let mut __tmp = BytesMut::new(bytes);
10645 #[allow(clippy::absurd_extreme_comparisons)]
10646 #[allow(unused_comparisons)]
10647 if __tmp.remaining() < Self::ENCODED_LEN {
10648 panic!(
10649 "buffer is too small (need {} bytes, but got {})",
10650 Self::ENCODED_LEN,
10651 __tmp.remaining(),
10652 )
10653 }
10654 __tmp.put_u16_le(self.message_rate);
10655 __tmp.put_u8(self.stream_id);
10656 __tmp.put_u8(self.on_off);
10657 if matches!(version, MavlinkVersion::V2) {
10658 let len = __tmp.len();
10659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10660 } else {
10661 __tmp.len()
10662 }
10663 }
10664}
10665#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10666#[doc = ""]
10667#[doc = "ID: 130"]
10668#[derive(Debug, Clone, PartialEq)]
10669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10671#[cfg_attr(feature = "ts", derive(TS))]
10672#[cfg_attr(feature = "ts", ts(export))]
10673pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10674 #[doc = "total data size (set on ACK only)."]
10675 pub size: u32,
10676 #[doc = "Width of a matrix or image."]
10677 pub width: u16,
10678 #[doc = "Height of a matrix or image."]
10679 pub height: u16,
10680 #[doc = "Number of packets being sent (set on ACK only)."]
10681 pub packets: u16,
10682 #[doc = "Type of requested/acknowledged data."]
10683 pub mavtype: MavlinkDataStreamType,
10684 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10685 pub payload: u8,
10686 #[doc = "JPEG quality. Values: [1-100]."]
10687 pub jpg_quality: u8,
10688}
10689impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10690 pub const ENCODED_LEN: usize = 13usize;
10691 pub const DEFAULT: Self = Self {
10692 size: 0_u32,
10693 width: 0_u16,
10694 height: 0_u16,
10695 packets: 0_u16,
10696 mavtype: MavlinkDataStreamType::DEFAULT,
10697 payload: 0_u8,
10698 jpg_quality: 0_u8,
10699 };
10700 #[cfg(feature = "arbitrary")]
10701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10702 use arbitrary::{Arbitrary, Unstructured};
10703 let mut buf = [0u8; 1024];
10704 rng.fill_bytes(&mut buf);
10705 let mut unstructured = Unstructured::new(&buf);
10706 Self::arbitrary(&mut unstructured).unwrap_or_default()
10707 }
10708}
10709impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10710 fn default() -> Self {
10711 Self::DEFAULT.clone()
10712 }
10713}
10714impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10715 type Message = MavMessage;
10716 const ID: u32 = 130u32;
10717 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10718 const EXTRA_CRC: u8 = 29u8;
10719 const ENCODED_LEN: usize = 13usize;
10720 fn deser(
10721 _version: MavlinkVersion,
10722 __input: &[u8],
10723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10724 let avail_len = __input.len();
10725 let mut payload_buf = [0; Self::ENCODED_LEN];
10726 let mut buf = if avail_len < Self::ENCODED_LEN {
10727 payload_buf[0..avail_len].copy_from_slice(__input);
10728 Bytes::new(&payload_buf)
10729 } else {
10730 Bytes::new(__input)
10731 };
10732 let mut __struct = Self::default();
10733 __struct.size = buf.get_u32_le()?;
10734 __struct.width = buf.get_u16_le()?;
10735 __struct.height = buf.get_u16_le()?;
10736 __struct.packets = buf.get_u16_le()?;
10737 let tmp = buf.get_u8()?;
10738 __struct.mavtype =
10739 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10740 enum_type: "MavlinkDataStreamType",
10741 value: tmp as u64,
10742 })?;
10743 __struct.payload = buf.get_u8()?;
10744 __struct.jpg_quality = buf.get_u8()?;
10745 Ok(__struct)
10746 }
10747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10748 let mut __tmp = BytesMut::new(bytes);
10749 #[allow(clippy::absurd_extreme_comparisons)]
10750 #[allow(unused_comparisons)]
10751 if __tmp.remaining() < Self::ENCODED_LEN {
10752 panic!(
10753 "buffer is too small (need {} bytes, but got {})",
10754 Self::ENCODED_LEN,
10755 __tmp.remaining(),
10756 )
10757 }
10758 __tmp.put_u32_le(self.size);
10759 __tmp.put_u16_le(self.width);
10760 __tmp.put_u16_le(self.height);
10761 __tmp.put_u16_le(self.packets);
10762 __tmp.put_u8(self.mavtype as u8);
10763 __tmp.put_u8(self.payload);
10764 __tmp.put_u8(self.jpg_quality);
10765 if matches!(version, MavlinkVersion::V2) {
10766 let len = __tmp.len();
10767 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10768 } else {
10769 __tmp.len()
10770 }
10771 }
10772}
10773#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10774#[doc = ""]
10775#[doc = "ID: 254"]
10776#[derive(Debug, Clone, PartialEq)]
10777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10778#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10779#[cfg_attr(feature = "ts", derive(TS))]
10780#[cfg_attr(feature = "ts", ts(export))]
10781pub struct DEBUG_DATA {
10782 #[doc = "Timestamp (time since system boot)."]
10783 pub time_boot_ms: u32,
10784 #[doc = "DEBUG value"]
10785 pub value: f32,
10786 #[doc = "index of debug variable"]
10787 pub ind: u8,
10788}
10789impl DEBUG_DATA {
10790 pub const ENCODED_LEN: usize = 9usize;
10791 pub const DEFAULT: Self = Self {
10792 time_boot_ms: 0_u32,
10793 value: 0.0_f32,
10794 ind: 0_u8,
10795 };
10796 #[cfg(feature = "arbitrary")]
10797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10798 use arbitrary::{Arbitrary, Unstructured};
10799 let mut buf = [0u8; 1024];
10800 rng.fill_bytes(&mut buf);
10801 let mut unstructured = Unstructured::new(&buf);
10802 Self::arbitrary(&mut unstructured).unwrap_or_default()
10803 }
10804}
10805impl Default for DEBUG_DATA {
10806 fn default() -> Self {
10807 Self::DEFAULT.clone()
10808 }
10809}
10810impl MessageData for DEBUG_DATA {
10811 type Message = MavMessage;
10812 const ID: u32 = 254u32;
10813 const NAME: &'static str = "DEBUG";
10814 const EXTRA_CRC: u8 = 46u8;
10815 const ENCODED_LEN: usize = 9usize;
10816 fn deser(
10817 _version: MavlinkVersion,
10818 __input: &[u8],
10819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10820 let avail_len = __input.len();
10821 let mut payload_buf = [0; Self::ENCODED_LEN];
10822 let mut buf = if avail_len < Self::ENCODED_LEN {
10823 payload_buf[0..avail_len].copy_from_slice(__input);
10824 Bytes::new(&payload_buf)
10825 } else {
10826 Bytes::new(__input)
10827 };
10828 let mut __struct = Self::default();
10829 __struct.time_boot_ms = buf.get_u32_le()?;
10830 __struct.value = buf.get_f32_le()?;
10831 __struct.ind = buf.get_u8()?;
10832 Ok(__struct)
10833 }
10834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10835 let mut __tmp = BytesMut::new(bytes);
10836 #[allow(clippy::absurd_extreme_comparisons)]
10837 #[allow(unused_comparisons)]
10838 if __tmp.remaining() < Self::ENCODED_LEN {
10839 panic!(
10840 "buffer is too small (need {} bytes, but got {})",
10841 Self::ENCODED_LEN,
10842 __tmp.remaining(),
10843 )
10844 }
10845 __tmp.put_u32_le(self.time_boot_ms);
10846 __tmp.put_f32_le(self.value);
10847 __tmp.put_u8(self.ind);
10848 if matches!(version, MavlinkVersion::V2) {
10849 let len = __tmp.len();
10850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10851 } else {
10852 __tmp.len()
10853 }
10854 }
10855}
10856#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10857#[doc = ""]
10858#[doc = "ID: 350"]
10859#[derive(Debug, Clone, PartialEq)]
10860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10862#[cfg_attr(feature = "ts", derive(TS))]
10863#[cfg_attr(feature = "ts", ts(export))]
10864pub struct DEBUG_FLOAT_ARRAY_DATA {
10865 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10866 pub time_usec: u64,
10867 #[doc = "Unique ID used to discriminate between arrays"]
10868 pub array_id: u16,
10869 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10870 #[cfg_attr(feature = "ts", ts(type = "string"))]
10871 pub name: CharArray<10>,
10872 #[doc = "data"]
10873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10874 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10875 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10876 pub data: [f32; 58],
10877}
10878impl DEBUG_FLOAT_ARRAY_DATA {
10879 pub const ENCODED_LEN: usize = 252usize;
10880 pub const DEFAULT: Self = Self {
10881 time_usec: 0_u64,
10882 array_id: 0_u16,
10883 name: CharArray::new([0_u8; 10usize]),
10884 data: [0.0_f32; 58usize],
10885 };
10886 #[cfg(feature = "arbitrary")]
10887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10888 use arbitrary::{Arbitrary, Unstructured};
10889 let mut buf = [0u8; 1024];
10890 rng.fill_bytes(&mut buf);
10891 let mut unstructured = Unstructured::new(&buf);
10892 Self::arbitrary(&mut unstructured).unwrap_or_default()
10893 }
10894}
10895impl Default for DEBUG_FLOAT_ARRAY_DATA {
10896 fn default() -> Self {
10897 Self::DEFAULT.clone()
10898 }
10899}
10900impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10901 type Message = MavMessage;
10902 const ID: u32 = 350u32;
10903 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10904 const EXTRA_CRC: u8 = 232u8;
10905 const ENCODED_LEN: usize = 252usize;
10906 fn deser(
10907 _version: MavlinkVersion,
10908 __input: &[u8],
10909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10910 let avail_len = __input.len();
10911 let mut payload_buf = [0; Self::ENCODED_LEN];
10912 let mut buf = if avail_len < Self::ENCODED_LEN {
10913 payload_buf[0..avail_len].copy_from_slice(__input);
10914 Bytes::new(&payload_buf)
10915 } else {
10916 Bytes::new(__input)
10917 };
10918 let mut __struct = Self::default();
10919 __struct.time_usec = buf.get_u64_le()?;
10920 __struct.array_id = buf.get_u16_le()?;
10921 let mut tmp = [0_u8; 10usize];
10922 for v in &mut tmp {
10923 *v = buf.get_u8()?;
10924 }
10925 __struct.name = CharArray::new(tmp);
10926 for v in &mut __struct.data {
10927 let val = buf.get_f32_le()?;
10928 *v = val;
10929 }
10930 Ok(__struct)
10931 }
10932 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10933 let mut __tmp = BytesMut::new(bytes);
10934 #[allow(clippy::absurd_extreme_comparisons)]
10935 #[allow(unused_comparisons)]
10936 if __tmp.remaining() < Self::ENCODED_LEN {
10937 panic!(
10938 "buffer is too small (need {} bytes, but got {})",
10939 Self::ENCODED_LEN,
10940 __tmp.remaining(),
10941 )
10942 }
10943 __tmp.put_u64_le(self.time_usec);
10944 __tmp.put_u16_le(self.array_id);
10945 for val in &self.name {
10946 __tmp.put_u8(*val);
10947 }
10948 if matches!(version, MavlinkVersion::V2) {
10949 for val in &self.data {
10950 __tmp.put_f32_le(*val);
10951 }
10952 let len = __tmp.len();
10953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10954 } else {
10955 __tmp.len()
10956 }
10957 }
10958}
10959#[doc = "To debug something using a named 3D vector."]
10960#[doc = ""]
10961#[doc = "ID: 250"]
10962#[derive(Debug, Clone, PartialEq)]
10963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10965#[cfg_attr(feature = "ts", derive(TS))]
10966#[cfg_attr(feature = "ts", ts(export))]
10967pub struct DEBUG_VECT_DATA {
10968 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10969 pub time_usec: u64,
10970 #[doc = "x"]
10971 pub x: f32,
10972 #[doc = "y"]
10973 pub y: f32,
10974 #[doc = "z"]
10975 pub z: f32,
10976 #[doc = "Name"]
10977 #[cfg_attr(feature = "ts", ts(type = "string"))]
10978 pub name: CharArray<10>,
10979}
10980impl DEBUG_VECT_DATA {
10981 pub const ENCODED_LEN: usize = 30usize;
10982 pub const DEFAULT: Self = Self {
10983 time_usec: 0_u64,
10984 x: 0.0_f32,
10985 y: 0.0_f32,
10986 z: 0.0_f32,
10987 name: CharArray::new([0_u8; 10usize]),
10988 };
10989 #[cfg(feature = "arbitrary")]
10990 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10991 use arbitrary::{Arbitrary, Unstructured};
10992 let mut buf = [0u8; 1024];
10993 rng.fill_bytes(&mut buf);
10994 let mut unstructured = Unstructured::new(&buf);
10995 Self::arbitrary(&mut unstructured).unwrap_or_default()
10996 }
10997}
10998impl Default for DEBUG_VECT_DATA {
10999 fn default() -> Self {
11000 Self::DEFAULT.clone()
11001 }
11002}
11003impl MessageData for DEBUG_VECT_DATA {
11004 type Message = MavMessage;
11005 const ID: u32 = 250u32;
11006 const NAME: &'static str = "DEBUG_VECT";
11007 const EXTRA_CRC: u8 = 49u8;
11008 const ENCODED_LEN: usize = 30usize;
11009 fn deser(
11010 _version: MavlinkVersion,
11011 __input: &[u8],
11012 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11013 let avail_len = __input.len();
11014 let mut payload_buf = [0; Self::ENCODED_LEN];
11015 let mut buf = if avail_len < Self::ENCODED_LEN {
11016 payload_buf[0..avail_len].copy_from_slice(__input);
11017 Bytes::new(&payload_buf)
11018 } else {
11019 Bytes::new(__input)
11020 };
11021 let mut __struct = Self::default();
11022 __struct.time_usec = buf.get_u64_le()?;
11023 __struct.x = buf.get_f32_le()?;
11024 __struct.y = buf.get_f32_le()?;
11025 __struct.z = buf.get_f32_le()?;
11026 let mut tmp = [0_u8; 10usize];
11027 for v in &mut tmp {
11028 *v = buf.get_u8()?;
11029 }
11030 __struct.name = CharArray::new(tmp);
11031 Ok(__struct)
11032 }
11033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11034 let mut __tmp = BytesMut::new(bytes);
11035 #[allow(clippy::absurd_extreme_comparisons)]
11036 #[allow(unused_comparisons)]
11037 if __tmp.remaining() < Self::ENCODED_LEN {
11038 panic!(
11039 "buffer is too small (need {} bytes, but got {})",
11040 Self::ENCODED_LEN,
11041 __tmp.remaining(),
11042 )
11043 }
11044 __tmp.put_u64_le(self.time_usec);
11045 __tmp.put_f32_le(self.x);
11046 __tmp.put_f32_le(self.y);
11047 __tmp.put_f32_le(self.z);
11048 for val in &self.name {
11049 __tmp.put_u8(*val);
11050 }
11051 if matches!(version, MavlinkVersion::V2) {
11052 let len = __tmp.len();
11053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11054 } else {
11055 __tmp.len()
11056 }
11057 }
11058}
11059#[doc = "Distance sensor information for an onboard rangefinder."]
11060#[doc = ""]
11061#[doc = "ID: 132"]
11062#[derive(Debug, Clone, PartialEq)]
11063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11065#[cfg_attr(feature = "ts", derive(TS))]
11066#[cfg_attr(feature = "ts", ts(export))]
11067pub struct DISTANCE_SENSOR_DATA {
11068 #[doc = "Timestamp (time since system boot)."]
11069 pub time_boot_ms: u32,
11070 #[doc = "Minimum distance the sensor can measure"]
11071 pub min_distance: u16,
11072 #[doc = "Maximum distance the sensor can measure"]
11073 pub max_distance: u16,
11074 #[doc = "Current distance reading"]
11075 pub current_distance: u16,
11076 #[doc = "Type of distance sensor."]
11077 pub mavtype: MavDistanceSensor,
11078 #[doc = "Onboard ID of the sensor"]
11079 pub id: u8,
11080 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
11081 pub orientation: MavSensorOrientation,
11082 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
11083 pub covariance: u8,
11084 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11085 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11086 pub horizontal_fov: f32,
11087 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11088 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11089 pub vertical_fov: f32,
11090 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
11091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11093 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11094 pub quaternion: [f32; 4],
11095 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
11096 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11097 pub signal_quality: u8,
11098}
11099impl DISTANCE_SENSOR_DATA {
11100 pub const ENCODED_LEN: usize = 39usize;
11101 pub const DEFAULT: Self = Self {
11102 time_boot_ms: 0_u32,
11103 min_distance: 0_u16,
11104 max_distance: 0_u16,
11105 current_distance: 0_u16,
11106 mavtype: MavDistanceSensor::DEFAULT,
11107 id: 0_u8,
11108 orientation: MavSensorOrientation::DEFAULT,
11109 covariance: 0_u8,
11110 horizontal_fov: 0.0_f32,
11111 vertical_fov: 0.0_f32,
11112 quaternion: [0.0_f32; 4usize],
11113 signal_quality: 0_u8,
11114 };
11115 #[cfg(feature = "arbitrary")]
11116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11117 use arbitrary::{Arbitrary, Unstructured};
11118 let mut buf = [0u8; 1024];
11119 rng.fill_bytes(&mut buf);
11120 let mut unstructured = Unstructured::new(&buf);
11121 Self::arbitrary(&mut unstructured).unwrap_or_default()
11122 }
11123}
11124impl Default for DISTANCE_SENSOR_DATA {
11125 fn default() -> Self {
11126 Self::DEFAULT.clone()
11127 }
11128}
11129impl MessageData for DISTANCE_SENSOR_DATA {
11130 type Message = MavMessage;
11131 const ID: u32 = 132u32;
11132 const NAME: &'static str = "DISTANCE_SENSOR";
11133 const EXTRA_CRC: u8 = 85u8;
11134 const ENCODED_LEN: usize = 39usize;
11135 fn deser(
11136 _version: MavlinkVersion,
11137 __input: &[u8],
11138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11139 let avail_len = __input.len();
11140 let mut payload_buf = [0; Self::ENCODED_LEN];
11141 let mut buf = if avail_len < Self::ENCODED_LEN {
11142 payload_buf[0..avail_len].copy_from_slice(__input);
11143 Bytes::new(&payload_buf)
11144 } else {
11145 Bytes::new(__input)
11146 };
11147 let mut __struct = Self::default();
11148 __struct.time_boot_ms = buf.get_u32_le()?;
11149 __struct.min_distance = buf.get_u16_le()?;
11150 __struct.max_distance = buf.get_u16_le()?;
11151 __struct.current_distance = buf.get_u16_le()?;
11152 let tmp = buf.get_u8()?;
11153 __struct.mavtype =
11154 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11155 enum_type: "MavDistanceSensor",
11156 value: tmp as u64,
11157 })?;
11158 __struct.id = buf.get_u8()?;
11159 let tmp = buf.get_u8()?;
11160 __struct.orientation =
11161 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11162 enum_type: "MavSensorOrientation",
11163 value: tmp as u64,
11164 })?;
11165 __struct.covariance = buf.get_u8()?;
11166 __struct.horizontal_fov = buf.get_f32_le()?;
11167 __struct.vertical_fov = buf.get_f32_le()?;
11168 for v in &mut __struct.quaternion {
11169 let val = buf.get_f32_le()?;
11170 *v = val;
11171 }
11172 __struct.signal_quality = buf.get_u8()?;
11173 Ok(__struct)
11174 }
11175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11176 let mut __tmp = BytesMut::new(bytes);
11177 #[allow(clippy::absurd_extreme_comparisons)]
11178 #[allow(unused_comparisons)]
11179 if __tmp.remaining() < Self::ENCODED_LEN {
11180 panic!(
11181 "buffer is too small (need {} bytes, but got {})",
11182 Self::ENCODED_LEN,
11183 __tmp.remaining(),
11184 )
11185 }
11186 __tmp.put_u32_le(self.time_boot_ms);
11187 __tmp.put_u16_le(self.min_distance);
11188 __tmp.put_u16_le(self.max_distance);
11189 __tmp.put_u16_le(self.current_distance);
11190 __tmp.put_u8(self.mavtype as u8);
11191 __tmp.put_u8(self.id);
11192 __tmp.put_u8(self.orientation as u8);
11193 __tmp.put_u8(self.covariance);
11194 if matches!(version, MavlinkVersion::V2) {
11195 __tmp.put_f32_le(self.horizontal_fov);
11196 __tmp.put_f32_le(self.vertical_fov);
11197 for val in &self.quaternion {
11198 __tmp.put_f32_le(*val);
11199 }
11200 __tmp.put_u8(self.signal_quality);
11201 let len = __tmp.len();
11202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11203 } else {
11204 __tmp.len()
11205 }
11206 }
11207}
11208#[doc = "EFI status output."]
11209#[doc = ""]
11210#[doc = "ID: 225"]
11211#[derive(Debug, Clone, PartialEq)]
11212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11214#[cfg_attr(feature = "ts", derive(TS))]
11215#[cfg_attr(feature = "ts", ts(export))]
11216pub struct EFI_STATUS_DATA {
11217 #[doc = "ECU index"]
11218 pub ecu_index: f32,
11219 #[doc = "RPM"]
11220 pub rpm: f32,
11221 #[doc = "Fuel consumed"]
11222 pub fuel_consumed: f32,
11223 #[doc = "Fuel flow rate"]
11224 pub fuel_flow: f32,
11225 #[doc = "Engine load"]
11226 pub engine_load: f32,
11227 #[doc = "Throttle position"]
11228 pub throttle_position: f32,
11229 #[doc = "Spark dwell time"]
11230 pub spark_dwell_time: f32,
11231 #[doc = "Barometric pressure"]
11232 pub barometric_pressure: f32,
11233 #[doc = "Intake manifold pressure("]
11234 pub intake_manifold_pressure: f32,
11235 #[doc = "Intake manifold temperature"]
11236 pub intake_manifold_temperature: f32,
11237 #[doc = "Cylinder head temperature"]
11238 pub cylinder_head_temperature: f32,
11239 #[doc = "Ignition timing (Crank angle degrees)"]
11240 pub ignition_timing: f32,
11241 #[doc = "Injection time"]
11242 pub injection_time: f32,
11243 #[doc = "Exhaust gas temperature"]
11244 pub exhaust_gas_temperature: f32,
11245 #[doc = "Output throttle"]
11246 pub throttle_out: f32,
11247 #[doc = "Pressure/temperature compensation"]
11248 pub pt_compensation: f32,
11249 #[doc = "EFI health status"]
11250 pub health: u8,
11251 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11253 pub ignition_voltage: f32,
11254 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11255 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11256 pub fuel_pressure: f32,
11257}
11258impl EFI_STATUS_DATA {
11259 pub const ENCODED_LEN: usize = 73usize;
11260 pub const DEFAULT: Self = Self {
11261 ecu_index: 0.0_f32,
11262 rpm: 0.0_f32,
11263 fuel_consumed: 0.0_f32,
11264 fuel_flow: 0.0_f32,
11265 engine_load: 0.0_f32,
11266 throttle_position: 0.0_f32,
11267 spark_dwell_time: 0.0_f32,
11268 barometric_pressure: 0.0_f32,
11269 intake_manifold_pressure: 0.0_f32,
11270 intake_manifold_temperature: 0.0_f32,
11271 cylinder_head_temperature: 0.0_f32,
11272 ignition_timing: 0.0_f32,
11273 injection_time: 0.0_f32,
11274 exhaust_gas_temperature: 0.0_f32,
11275 throttle_out: 0.0_f32,
11276 pt_compensation: 0.0_f32,
11277 health: 0_u8,
11278 ignition_voltage: 0.0_f32,
11279 fuel_pressure: 0.0_f32,
11280 };
11281 #[cfg(feature = "arbitrary")]
11282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11283 use arbitrary::{Arbitrary, Unstructured};
11284 let mut buf = [0u8; 1024];
11285 rng.fill_bytes(&mut buf);
11286 let mut unstructured = Unstructured::new(&buf);
11287 Self::arbitrary(&mut unstructured).unwrap_or_default()
11288 }
11289}
11290impl Default for EFI_STATUS_DATA {
11291 fn default() -> Self {
11292 Self::DEFAULT.clone()
11293 }
11294}
11295impl MessageData for EFI_STATUS_DATA {
11296 type Message = MavMessage;
11297 const ID: u32 = 225u32;
11298 const NAME: &'static str = "EFI_STATUS";
11299 const EXTRA_CRC: u8 = 208u8;
11300 const ENCODED_LEN: usize = 73usize;
11301 fn deser(
11302 _version: MavlinkVersion,
11303 __input: &[u8],
11304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11305 let avail_len = __input.len();
11306 let mut payload_buf = [0; Self::ENCODED_LEN];
11307 let mut buf = if avail_len < Self::ENCODED_LEN {
11308 payload_buf[0..avail_len].copy_from_slice(__input);
11309 Bytes::new(&payload_buf)
11310 } else {
11311 Bytes::new(__input)
11312 };
11313 let mut __struct = Self::default();
11314 __struct.ecu_index = buf.get_f32_le()?;
11315 __struct.rpm = buf.get_f32_le()?;
11316 __struct.fuel_consumed = buf.get_f32_le()?;
11317 __struct.fuel_flow = buf.get_f32_le()?;
11318 __struct.engine_load = buf.get_f32_le()?;
11319 __struct.throttle_position = buf.get_f32_le()?;
11320 __struct.spark_dwell_time = buf.get_f32_le()?;
11321 __struct.barometric_pressure = buf.get_f32_le()?;
11322 __struct.intake_manifold_pressure = buf.get_f32_le()?;
11323 __struct.intake_manifold_temperature = buf.get_f32_le()?;
11324 __struct.cylinder_head_temperature = buf.get_f32_le()?;
11325 __struct.ignition_timing = buf.get_f32_le()?;
11326 __struct.injection_time = buf.get_f32_le()?;
11327 __struct.exhaust_gas_temperature = buf.get_f32_le()?;
11328 __struct.throttle_out = buf.get_f32_le()?;
11329 __struct.pt_compensation = buf.get_f32_le()?;
11330 __struct.health = buf.get_u8()?;
11331 __struct.ignition_voltage = buf.get_f32_le()?;
11332 __struct.fuel_pressure = buf.get_f32_le()?;
11333 Ok(__struct)
11334 }
11335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11336 let mut __tmp = BytesMut::new(bytes);
11337 #[allow(clippy::absurd_extreme_comparisons)]
11338 #[allow(unused_comparisons)]
11339 if __tmp.remaining() < Self::ENCODED_LEN {
11340 panic!(
11341 "buffer is too small (need {} bytes, but got {})",
11342 Self::ENCODED_LEN,
11343 __tmp.remaining(),
11344 )
11345 }
11346 __tmp.put_f32_le(self.ecu_index);
11347 __tmp.put_f32_le(self.rpm);
11348 __tmp.put_f32_le(self.fuel_consumed);
11349 __tmp.put_f32_le(self.fuel_flow);
11350 __tmp.put_f32_le(self.engine_load);
11351 __tmp.put_f32_le(self.throttle_position);
11352 __tmp.put_f32_le(self.spark_dwell_time);
11353 __tmp.put_f32_le(self.barometric_pressure);
11354 __tmp.put_f32_le(self.intake_manifold_pressure);
11355 __tmp.put_f32_le(self.intake_manifold_temperature);
11356 __tmp.put_f32_le(self.cylinder_head_temperature);
11357 __tmp.put_f32_le(self.ignition_timing);
11358 __tmp.put_f32_le(self.injection_time);
11359 __tmp.put_f32_le(self.exhaust_gas_temperature);
11360 __tmp.put_f32_le(self.throttle_out);
11361 __tmp.put_f32_le(self.pt_compensation);
11362 __tmp.put_u8(self.health);
11363 if matches!(version, MavlinkVersion::V2) {
11364 __tmp.put_f32_le(self.ignition_voltage);
11365 __tmp.put_f32_le(self.fuel_pressure);
11366 let len = __tmp.len();
11367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11368 } else {
11369 __tmp.len()
11370 }
11371 }
11372}
11373#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11374#[doc = ""]
11375#[doc = "ID: 131"]
11376#[derive(Debug, Clone, PartialEq)]
11377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11379#[cfg_attr(feature = "ts", derive(TS))]
11380#[cfg_attr(feature = "ts", ts(export))]
11381pub struct ENCAPSULATED_DATA_DATA {
11382 #[doc = "sequence number (starting with 0 on every transmission)"]
11383 pub seqnr: u16,
11384 #[doc = "image data bytes"]
11385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11386 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11387 pub data: [u8; 253],
11388}
11389impl ENCAPSULATED_DATA_DATA {
11390 pub const ENCODED_LEN: usize = 255usize;
11391 pub const DEFAULT: Self = Self {
11392 seqnr: 0_u16,
11393 data: [0_u8; 253usize],
11394 };
11395 #[cfg(feature = "arbitrary")]
11396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11397 use arbitrary::{Arbitrary, Unstructured};
11398 let mut buf = [0u8; 1024];
11399 rng.fill_bytes(&mut buf);
11400 let mut unstructured = Unstructured::new(&buf);
11401 Self::arbitrary(&mut unstructured).unwrap_or_default()
11402 }
11403}
11404impl Default for ENCAPSULATED_DATA_DATA {
11405 fn default() -> Self {
11406 Self::DEFAULT.clone()
11407 }
11408}
11409impl MessageData for ENCAPSULATED_DATA_DATA {
11410 type Message = MavMessage;
11411 const ID: u32 = 131u32;
11412 const NAME: &'static str = "ENCAPSULATED_DATA";
11413 const EXTRA_CRC: u8 = 223u8;
11414 const ENCODED_LEN: usize = 255usize;
11415 fn deser(
11416 _version: MavlinkVersion,
11417 __input: &[u8],
11418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11419 let avail_len = __input.len();
11420 let mut payload_buf = [0; Self::ENCODED_LEN];
11421 let mut buf = if avail_len < Self::ENCODED_LEN {
11422 payload_buf[0..avail_len].copy_from_slice(__input);
11423 Bytes::new(&payload_buf)
11424 } else {
11425 Bytes::new(__input)
11426 };
11427 let mut __struct = Self::default();
11428 __struct.seqnr = buf.get_u16_le()?;
11429 for v in &mut __struct.data {
11430 let val = buf.get_u8()?;
11431 *v = val;
11432 }
11433 Ok(__struct)
11434 }
11435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11436 let mut __tmp = BytesMut::new(bytes);
11437 #[allow(clippy::absurd_extreme_comparisons)]
11438 #[allow(unused_comparisons)]
11439 if __tmp.remaining() < Self::ENCODED_LEN {
11440 panic!(
11441 "buffer is too small (need {} bytes, but got {})",
11442 Self::ENCODED_LEN,
11443 __tmp.remaining(),
11444 )
11445 }
11446 __tmp.put_u16_le(self.seqnr);
11447 for val in &self.data {
11448 __tmp.put_u8(*val);
11449 }
11450 if matches!(version, MavlinkVersion::V2) {
11451 let len = __tmp.len();
11452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11453 } else {
11454 __tmp.len()
11455 }
11456 }
11457}
11458#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11459#[doc = ""]
11460#[doc = "ID: 290"]
11461#[derive(Debug, Clone, PartialEq)]
11462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11464#[cfg_attr(feature = "ts", derive(TS))]
11465#[cfg_attr(feature = "ts", ts(export))]
11466pub struct ESC_INFO_DATA {
11467 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11468 pub time_usec: u64,
11469 #[doc = "Number of reported errors by each ESC since boot."]
11470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11471 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11472 pub error_count: [u32; 4],
11473 #[doc = "Counter of data packets received."]
11474 pub counter: u16,
11475 #[doc = "Bitmap of ESC failure flags."]
11476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11477 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11478 pub failure_flags: [u16; 4],
11479 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11481 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11482 pub temperature: [i16; 4],
11483 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11484 pub index: u8,
11485 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11486 pub count: u8,
11487 #[doc = "Connection type protocol for all ESC."]
11488 pub connection_type: EscConnectionType,
11489 #[doc = "Information regarding online/offline status of each ESC."]
11490 pub info: u8,
11491}
11492impl ESC_INFO_DATA {
11493 pub const ENCODED_LEN: usize = 46usize;
11494 pub const DEFAULT: Self = Self {
11495 time_usec: 0_u64,
11496 error_count: [0_u32; 4usize],
11497 counter: 0_u16,
11498 failure_flags: [0_u16; 4usize],
11499 temperature: [0_i16; 4usize],
11500 index: 0_u8,
11501 count: 0_u8,
11502 connection_type: EscConnectionType::DEFAULT,
11503 info: 0_u8,
11504 };
11505 #[cfg(feature = "arbitrary")]
11506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11507 use arbitrary::{Arbitrary, Unstructured};
11508 let mut buf = [0u8; 1024];
11509 rng.fill_bytes(&mut buf);
11510 let mut unstructured = Unstructured::new(&buf);
11511 Self::arbitrary(&mut unstructured).unwrap_or_default()
11512 }
11513}
11514impl Default for ESC_INFO_DATA {
11515 fn default() -> Self {
11516 Self::DEFAULT.clone()
11517 }
11518}
11519impl MessageData for ESC_INFO_DATA {
11520 type Message = MavMessage;
11521 const ID: u32 = 290u32;
11522 const NAME: &'static str = "ESC_INFO";
11523 const EXTRA_CRC: u8 = 251u8;
11524 const ENCODED_LEN: usize = 46usize;
11525 fn deser(
11526 _version: MavlinkVersion,
11527 __input: &[u8],
11528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11529 let avail_len = __input.len();
11530 let mut payload_buf = [0; Self::ENCODED_LEN];
11531 let mut buf = if avail_len < Self::ENCODED_LEN {
11532 payload_buf[0..avail_len].copy_from_slice(__input);
11533 Bytes::new(&payload_buf)
11534 } else {
11535 Bytes::new(__input)
11536 };
11537 let mut __struct = Self::default();
11538 __struct.time_usec = buf.get_u64_le()?;
11539 for v in &mut __struct.error_count {
11540 let val = buf.get_u32_le()?;
11541 *v = val;
11542 }
11543 __struct.counter = buf.get_u16_le()?;
11544 for v in &mut __struct.failure_flags {
11545 let val = buf.get_u16_le()?;
11546 *v = val;
11547 }
11548 for v in &mut __struct.temperature {
11549 let val = buf.get_i16_le()?;
11550 *v = val;
11551 }
11552 __struct.index = buf.get_u8()?;
11553 __struct.count = buf.get_u8()?;
11554 let tmp = buf.get_u8()?;
11555 __struct.connection_type =
11556 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11557 enum_type: "EscConnectionType",
11558 value: tmp as u64,
11559 })?;
11560 __struct.info = buf.get_u8()?;
11561 Ok(__struct)
11562 }
11563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11564 let mut __tmp = BytesMut::new(bytes);
11565 #[allow(clippy::absurd_extreme_comparisons)]
11566 #[allow(unused_comparisons)]
11567 if __tmp.remaining() < Self::ENCODED_LEN {
11568 panic!(
11569 "buffer is too small (need {} bytes, but got {})",
11570 Self::ENCODED_LEN,
11571 __tmp.remaining(),
11572 )
11573 }
11574 __tmp.put_u64_le(self.time_usec);
11575 for val in &self.error_count {
11576 __tmp.put_u32_le(*val);
11577 }
11578 __tmp.put_u16_le(self.counter);
11579 for val in &self.failure_flags {
11580 __tmp.put_u16_le(*val);
11581 }
11582 for val in &self.temperature {
11583 __tmp.put_i16_le(*val);
11584 }
11585 __tmp.put_u8(self.index);
11586 __tmp.put_u8(self.count);
11587 __tmp.put_u8(self.connection_type as u8);
11588 __tmp.put_u8(self.info);
11589 if matches!(version, MavlinkVersion::V2) {
11590 let len = __tmp.len();
11591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11592 } else {
11593 __tmp.len()
11594 }
11595 }
11596}
11597#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11598#[doc = ""]
11599#[doc = "ID: 291"]
11600#[derive(Debug, Clone, PartialEq)]
11601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11603#[cfg_attr(feature = "ts", derive(TS))]
11604#[cfg_attr(feature = "ts", ts(export))]
11605pub struct ESC_STATUS_DATA {
11606 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11607 pub time_usec: u64,
11608 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11609 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11610 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11611 pub rpm: [i32; 4],
11612 #[doc = "Voltage measured from each ESC."]
11613 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11614 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11615 pub voltage: [f32; 4],
11616 #[doc = "Current measured from each ESC."]
11617 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11618 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11619 pub current: [f32; 4],
11620 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11621 pub index: u8,
11622}
11623impl ESC_STATUS_DATA {
11624 pub const ENCODED_LEN: usize = 57usize;
11625 pub const DEFAULT: Self = Self {
11626 time_usec: 0_u64,
11627 rpm: [0_i32; 4usize],
11628 voltage: [0.0_f32; 4usize],
11629 current: [0.0_f32; 4usize],
11630 index: 0_u8,
11631 };
11632 #[cfg(feature = "arbitrary")]
11633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11634 use arbitrary::{Arbitrary, Unstructured};
11635 let mut buf = [0u8; 1024];
11636 rng.fill_bytes(&mut buf);
11637 let mut unstructured = Unstructured::new(&buf);
11638 Self::arbitrary(&mut unstructured).unwrap_or_default()
11639 }
11640}
11641impl Default for ESC_STATUS_DATA {
11642 fn default() -> Self {
11643 Self::DEFAULT.clone()
11644 }
11645}
11646impl MessageData for ESC_STATUS_DATA {
11647 type Message = MavMessage;
11648 const ID: u32 = 291u32;
11649 const NAME: &'static str = "ESC_STATUS";
11650 const EXTRA_CRC: u8 = 10u8;
11651 const ENCODED_LEN: usize = 57usize;
11652 fn deser(
11653 _version: MavlinkVersion,
11654 __input: &[u8],
11655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11656 let avail_len = __input.len();
11657 let mut payload_buf = [0; Self::ENCODED_LEN];
11658 let mut buf = if avail_len < Self::ENCODED_LEN {
11659 payload_buf[0..avail_len].copy_from_slice(__input);
11660 Bytes::new(&payload_buf)
11661 } else {
11662 Bytes::new(__input)
11663 };
11664 let mut __struct = Self::default();
11665 __struct.time_usec = buf.get_u64_le()?;
11666 for v in &mut __struct.rpm {
11667 let val = buf.get_i32_le()?;
11668 *v = val;
11669 }
11670 for v in &mut __struct.voltage {
11671 let val = buf.get_f32_le()?;
11672 *v = val;
11673 }
11674 for v in &mut __struct.current {
11675 let val = buf.get_f32_le()?;
11676 *v = val;
11677 }
11678 __struct.index = buf.get_u8()?;
11679 Ok(__struct)
11680 }
11681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11682 let mut __tmp = BytesMut::new(bytes);
11683 #[allow(clippy::absurd_extreme_comparisons)]
11684 #[allow(unused_comparisons)]
11685 if __tmp.remaining() < Self::ENCODED_LEN {
11686 panic!(
11687 "buffer is too small (need {} bytes, but got {})",
11688 Self::ENCODED_LEN,
11689 __tmp.remaining(),
11690 )
11691 }
11692 __tmp.put_u64_le(self.time_usec);
11693 for val in &self.rpm {
11694 __tmp.put_i32_le(*val);
11695 }
11696 for val in &self.voltage {
11697 __tmp.put_f32_le(*val);
11698 }
11699 for val in &self.current {
11700 __tmp.put_f32_le(*val);
11701 }
11702 __tmp.put_u8(self.index);
11703 if matches!(version, MavlinkVersion::V2) {
11704 let len = __tmp.len();
11705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11706 } else {
11707 __tmp.len()
11708 }
11709 }
11710}
11711#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11712#[doc = ""]
11713#[doc = "ID: 230"]
11714#[derive(Debug, Clone, PartialEq)]
11715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11717#[cfg_attr(feature = "ts", derive(TS))]
11718#[cfg_attr(feature = "ts", ts(export))]
11719pub struct ESTIMATOR_STATUS_DATA {
11720 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11721 pub time_usec: u64,
11722 #[doc = "Velocity innovation test ratio"]
11723 pub vel_ratio: f32,
11724 #[doc = "Horizontal position innovation test ratio"]
11725 pub pos_horiz_ratio: f32,
11726 #[doc = "Vertical position innovation test ratio"]
11727 pub pos_vert_ratio: f32,
11728 #[doc = "Magnetometer innovation test ratio"]
11729 pub mag_ratio: f32,
11730 #[doc = "Height above terrain innovation test ratio"]
11731 pub hagl_ratio: f32,
11732 #[doc = "True airspeed innovation test ratio"]
11733 pub tas_ratio: f32,
11734 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11735 pub pos_horiz_accuracy: f32,
11736 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11737 pub pos_vert_accuracy: f32,
11738 #[doc = "Bitmap indicating which EKF outputs are valid."]
11739 pub flags: EstimatorStatusFlags,
11740}
11741impl ESTIMATOR_STATUS_DATA {
11742 pub const ENCODED_LEN: usize = 42usize;
11743 pub const DEFAULT: Self = Self {
11744 time_usec: 0_u64,
11745 vel_ratio: 0.0_f32,
11746 pos_horiz_ratio: 0.0_f32,
11747 pos_vert_ratio: 0.0_f32,
11748 mag_ratio: 0.0_f32,
11749 hagl_ratio: 0.0_f32,
11750 tas_ratio: 0.0_f32,
11751 pos_horiz_accuracy: 0.0_f32,
11752 pos_vert_accuracy: 0.0_f32,
11753 flags: EstimatorStatusFlags::DEFAULT,
11754 };
11755 #[cfg(feature = "arbitrary")]
11756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11757 use arbitrary::{Arbitrary, Unstructured};
11758 let mut buf = [0u8; 1024];
11759 rng.fill_bytes(&mut buf);
11760 let mut unstructured = Unstructured::new(&buf);
11761 Self::arbitrary(&mut unstructured).unwrap_or_default()
11762 }
11763}
11764impl Default for ESTIMATOR_STATUS_DATA {
11765 fn default() -> Self {
11766 Self::DEFAULT.clone()
11767 }
11768}
11769impl MessageData for ESTIMATOR_STATUS_DATA {
11770 type Message = MavMessage;
11771 const ID: u32 = 230u32;
11772 const NAME: &'static str = "ESTIMATOR_STATUS";
11773 const EXTRA_CRC: u8 = 163u8;
11774 const ENCODED_LEN: usize = 42usize;
11775 fn deser(
11776 _version: MavlinkVersion,
11777 __input: &[u8],
11778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11779 let avail_len = __input.len();
11780 let mut payload_buf = [0; Self::ENCODED_LEN];
11781 let mut buf = if avail_len < Self::ENCODED_LEN {
11782 payload_buf[0..avail_len].copy_from_slice(__input);
11783 Bytes::new(&payload_buf)
11784 } else {
11785 Bytes::new(__input)
11786 };
11787 let mut __struct = Self::default();
11788 __struct.time_usec = buf.get_u64_le()?;
11789 __struct.vel_ratio = buf.get_f32_le()?;
11790 __struct.pos_horiz_ratio = buf.get_f32_le()?;
11791 __struct.pos_vert_ratio = buf.get_f32_le()?;
11792 __struct.mag_ratio = buf.get_f32_le()?;
11793 __struct.hagl_ratio = buf.get_f32_le()?;
11794 __struct.tas_ratio = buf.get_f32_le()?;
11795 __struct.pos_horiz_accuracy = buf.get_f32_le()?;
11796 __struct.pos_vert_accuracy = buf.get_f32_le()?;
11797 let tmp = buf.get_u16_le()?;
11798 __struct.flags = EstimatorStatusFlags::from_bits(
11799 tmp as <EstimatorStatusFlags as Flags>::Bits,
11800 )
11801 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11802 flag_type: "EstimatorStatusFlags",
11803 value: tmp as u64,
11804 })?;
11805 Ok(__struct)
11806 }
11807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11808 let mut __tmp = BytesMut::new(bytes);
11809 #[allow(clippy::absurd_extreme_comparisons)]
11810 #[allow(unused_comparisons)]
11811 if __tmp.remaining() < Self::ENCODED_LEN {
11812 panic!(
11813 "buffer is too small (need {} bytes, but got {})",
11814 Self::ENCODED_LEN,
11815 __tmp.remaining(),
11816 )
11817 }
11818 __tmp.put_u64_le(self.time_usec);
11819 __tmp.put_f32_le(self.vel_ratio);
11820 __tmp.put_f32_le(self.pos_horiz_ratio);
11821 __tmp.put_f32_le(self.pos_vert_ratio);
11822 __tmp.put_f32_le(self.mag_ratio);
11823 __tmp.put_f32_le(self.hagl_ratio);
11824 __tmp.put_f32_le(self.tas_ratio);
11825 __tmp.put_f32_le(self.pos_horiz_accuracy);
11826 __tmp.put_f32_le(self.pos_vert_accuracy);
11827 __tmp.put_u16_le(self.flags.bits() as u16);
11828 if matches!(version, MavlinkVersion::V2) {
11829 let len = __tmp.len();
11830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11831 } else {
11832 __tmp.len()
11833 }
11834 }
11835}
11836#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11837#[doc = ""]
11838#[doc = "ID: 410"]
11839#[derive(Debug, Clone, PartialEq)]
11840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11842#[cfg_attr(feature = "ts", derive(TS))]
11843#[cfg_attr(feature = "ts", ts(export))]
11844pub struct EVENT_DATA {
11845 #[doc = "Event ID (as defined in the component metadata)"]
11846 pub id: u32,
11847 #[doc = "Timestamp (time since system boot when the event happened)."]
11848 pub event_time_boot_ms: u32,
11849 #[doc = "Sequence number."]
11850 pub sequence: u16,
11851 #[doc = "Component ID"]
11852 pub destination_component: u8,
11853 #[doc = "System ID"]
11854 pub destination_system: u8,
11855 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11856 pub log_levels: u8,
11857 #[doc = "Arguments (depend on event ID)."]
11858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11859 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11860 pub arguments: [u8; 40],
11861}
11862impl EVENT_DATA {
11863 pub const ENCODED_LEN: usize = 53usize;
11864 pub const DEFAULT: Self = Self {
11865 id: 0_u32,
11866 event_time_boot_ms: 0_u32,
11867 sequence: 0_u16,
11868 destination_component: 0_u8,
11869 destination_system: 0_u8,
11870 log_levels: 0_u8,
11871 arguments: [0_u8; 40usize],
11872 };
11873 #[cfg(feature = "arbitrary")]
11874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11875 use arbitrary::{Arbitrary, Unstructured};
11876 let mut buf = [0u8; 1024];
11877 rng.fill_bytes(&mut buf);
11878 let mut unstructured = Unstructured::new(&buf);
11879 Self::arbitrary(&mut unstructured).unwrap_or_default()
11880 }
11881}
11882impl Default for EVENT_DATA {
11883 fn default() -> Self {
11884 Self::DEFAULT.clone()
11885 }
11886}
11887impl MessageData for EVENT_DATA {
11888 type Message = MavMessage;
11889 const ID: u32 = 410u32;
11890 const NAME: &'static str = "EVENT";
11891 const EXTRA_CRC: u8 = 160u8;
11892 const ENCODED_LEN: usize = 53usize;
11893 fn deser(
11894 _version: MavlinkVersion,
11895 __input: &[u8],
11896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11897 let avail_len = __input.len();
11898 let mut payload_buf = [0; Self::ENCODED_LEN];
11899 let mut buf = if avail_len < Self::ENCODED_LEN {
11900 payload_buf[0..avail_len].copy_from_slice(__input);
11901 Bytes::new(&payload_buf)
11902 } else {
11903 Bytes::new(__input)
11904 };
11905 let mut __struct = Self::default();
11906 __struct.id = buf.get_u32_le()?;
11907 __struct.event_time_boot_ms = buf.get_u32_le()?;
11908 __struct.sequence = buf.get_u16_le()?;
11909 __struct.destination_component = buf.get_u8()?;
11910 __struct.destination_system = buf.get_u8()?;
11911 __struct.log_levels = buf.get_u8()?;
11912 for v in &mut __struct.arguments {
11913 let val = buf.get_u8()?;
11914 *v = val;
11915 }
11916 Ok(__struct)
11917 }
11918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11919 let mut __tmp = BytesMut::new(bytes);
11920 #[allow(clippy::absurd_extreme_comparisons)]
11921 #[allow(unused_comparisons)]
11922 if __tmp.remaining() < Self::ENCODED_LEN {
11923 panic!(
11924 "buffer is too small (need {} bytes, but got {})",
11925 Self::ENCODED_LEN,
11926 __tmp.remaining(),
11927 )
11928 }
11929 __tmp.put_u32_le(self.id);
11930 __tmp.put_u32_le(self.event_time_boot_ms);
11931 __tmp.put_u16_le(self.sequence);
11932 __tmp.put_u8(self.destination_component);
11933 __tmp.put_u8(self.destination_system);
11934 __tmp.put_u8(self.log_levels);
11935 for val in &self.arguments {
11936 __tmp.put_u8(*val);
11937 }
11938 if matches!(version, MavlinkVersion::V2) {
11939 let len = __tmp.len();
11940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11941 } else {
11942 __tmp.len()
11943 }
11944 }
11945}
11946#[doc = "Provides state for additional features."]
11947#[doc = ""]
11948#[doc = "ID: 245"]
11949#[derive(Debug, Clone, PartialEq)]
11950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11952#[cfg_attr(feature = "ts", derive(TS))]
11953#[cfg_attr(feature = "ts", ts(export))]
11954pub struct EXTENDED_SYS_STATE_DATA {
11955 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11956 pub vtol_state: MavVtolState,
11957 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11958 pub landed_state: MavLandedState,
11959}
11960impl EXTENDED_SYS_STATE_DATA {
11961 pub const ENCODED_LEN: usize = 2usize;
11962 pub const DEFAULT: Self = Self {
11963 vtol_state: MavVtolState::DEFAULT,
11964 landed_state: MavLandedState::DEFAULT,
11965 };
11966 #[cfg(feature = "arbitrary")]
11967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11968 use arbitrary::{Arbitrary, Unstructured};
11969 let mut buf = [0u8; 1024];
11970 rng.fill_bytes(&mut buf);
11971 let mut unstructured = Unstructured::new(&buf);
11972 Self::arbitrary(&mut unstructured).unwrap_or_default()
11973 }
11974}
11975impl Default for EXTENDED_SYS_STATE_DATA {
11976 fn default() -> Self {
11977 Self::DEFAULT.clone()
11978 }
11979}
11980impl MessageData for EXTENDED_SYS_STATE_DATA {
11981 type Message = MavMessage;
11982 const ID: u32 = 245u32;
11983 const NAME: &'static str = "EXTENDED_SYS_STATE";
11984 const EXTRA_CRC: u8 = 130u8;
11985 const ENCODED_LEN: usize = 2usize;
11986 fn deser(
11987 _version: MavlinkVersion,
11988 __input: &[u8],
11989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11990 let avail_len = __input.len();
11991 let mut payload_buf = [0; Self::ENCODED_LEN];
11992 let mut buf = if avail_len < Self::ENCODED_LEN {
11993 payload_buf[0..avail_len].copy_from_slice(__input);
11994 Bytes::new(&payload_buf)
11995 } else {
11996 Bytes::new(__input)
11997 };
11998 let mut __struct = Self::default();
11999 let tmp = buf.get_u8()?;
12000 __struct.vtol_state =
12001 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12002 enum_type: "MavVtolState",
12003 value: tmp as u64,
12004 })?;
12005 let tmp = buf.get_u8()?;
12006 __struct.landed_state =
12007 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12008 enum_type: "MavLandedState",
12009 value: tmp as u64,
12010 })?;
12011 Ok(__struct)
12012 }
12013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12014 let mut __tmp = BytesMut::new(bytes);
12015 #[allow(clippy::absurd_extreme_comparisons)]
12016 #[allow(unused_comparisons)]
12017 if __tmp.remaining() < Self::ENCODED_LEN {
12018 panic!(
12019 "buffer is too small (need {} bytes, but got {})",
12020 Self::ENCODED_LEN,
12021 __tmp.remaining(),
12022 )
12023 }
12024 __tmp.put_u8(self.vtol_state as u8);
12025 __tmp.put_u8(self.landed_state as u8);
12026 if matches!(version, MavlinkVersion::V2) {
12027 let len = __tmp.len();
12028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12029 } else {
12030 __tmp.len()
12031 }
12032 }
12033}
12034#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
12035#[doc = ""]
12036#[doc = "ID: 162"]
12037#[derive(Debug, Clone, PartialEq)]
12038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12040#[cfg_attr(feature = "ts", derive(TS))]
12041#[cfg_attr(feature = "ts", ts(export))]
12042pub struct FENCE_STATUS_DATA {
12043 #[doc = "Time (since boot) of last breach."]
12044 pub breach_time: u32,
12045 #[doc = "Number of fence breaches."]
12046 pub breach_count: u16,
12047 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
12048 pub breach_status: u8,
12049 #[doc = "Last breach type."]
12050 pub breach_type: FenceBreach,
12051 #[doc = "Active action to prevent fence breach"]
12052 #[cfg_attr(feature = "serde", serde(default))]
12053 pub breach_mitigation: FenceMitigate,
12054}
12055impl FENCE_STATUS_DATA {
12056 pub const ENCODED_LEN: usize = 9usize;
12057 pub const DEFAULT: Self = Self {
12058 breach_time: 0_u32,
12059 breach_count: 0_u16,
12060 breach_status: 0_u8,
12061 breach_type: FenceBreach::DEFAULT,
12062 breach_mitigation: FenceMitigate::DEFAULT,
12063 };
12064 #[cfg(feature = "arbitrary")]
12065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12066 use arbitrary::{Arbitrary, Unstructured};
12067 let mut buf = [0u8; 1024];
12068 rng.fill_bytes(&mut buf);
12069 let mut unstructured = Unstructured::new(&buf);
12070 Self::arbitrary(&mut unstructured).unwrap_or_default()
12071 }
12072}
12073impl Default for FENCE_STATUS_DATA {
12074 fn default() -> Self {
12075 Self::DEFAULT.clone()
12076 }
12077}
12078impl MessageData for FENCE_STATUS_DATA {
12079 type Message = MavMessage;
12080 const ID: u32 = 162u32;
12081 const NAME: &'static str = "FENCE_STATUS";
12082 const EXTRA_CRC: u8 = 189u8;
12083 const ENCODED_LEN: usize = 9usize;
12084 fn deser(
12085 _version: MavlinkVersion,
12086 __input: &[u8],
12087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12088 let avail_len = __input.len();
12089 let mut payload_buf = [0; Self::ENCODED_LEN];
12090 let mut buf = if avail_len < Self::ENCODED_LEN {
12091 payload_buf[0..avail_len].copy_from_slice(__input);
12092 Bytes::new(&payload_buf)
12093 } else {
12094 Bytes::new(__input)
12095 };
12096 let mut __struct = Self::default();
12097 __struct.breach_time = buf.get_u32_le()?;
12098 __struct.breach_count = buf.get_u16_le()?;
12099 __struct.breach_status = buf.get_u8()?;
12100 let tmp = buf.get_u8()?;
12101 __struct.breach_type =
12102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12103 enum_type: "FenceBreach",
12104 value: tmp as u64,
12105 })?;
12106 let tmp = buf.get_u8()?;
12107 __struct.breach_mitigation =
12108 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12109 enum_type: "FenceMitigate",
12110 value: tmp as u64,
12111 })?;
12112 Ok(__struct)
12113 }
12114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12115 let mut __tmp = BytesMut::new(bytes);
12116 #[allow(clippy::absurd_extreme_comparisons)]
12117 #[allow(unused_comparisons)]
12118 if __tmp.remaining() < Self::ENCODED_LEN {
12119 panic!(
12120 "buffer is too small (need {} bytes, but got {})",
12121 Self::ENCODED_LEN,
12122 __tmp.remaining(),
12123 )
12124 }
12125 __tmp.put_u32_le(self.breach_time);
12126 __tmp.put_u16_le(self.breach_count);
12127 __tmp.put_u8(self.breach_status);
12128 __tmp.put_u8(self.breach_type as u8);
12129 if matches!(version, MavlinkVersion::V2) {
12130 __tmp.put_u8(self.breach_mitigation as u8);
12131 let len = __tmp.len();
12132 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12133 } else {
12134 __tmp.len()
12135 }
12136 }
12137}
12138#[doc = "Vehicle status report that is sent out while figure eight execution is in progress (see MAV_CMD_DO_FIGURE_EIGHT). This may typically send at low rates: of the order of 2Hz."]
12139#[doc = ""]
12140#[doc = "ID: 361"]
12141#[derive(Debug, Clone, PartialEq)]
12142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12144#[cfg_attr(feature = "ts", derive(TS))]
12145#[cfg_attr(feature = "ts", ts(export))]
12146pub struct FIGURE_EIGHT_EXECUTION_STATUS_DATA {
12147 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12148 pub time_usec: u64,
12149 #[doc = "Major axis radius of the figure eight. Positive: orbit the north circle clockwise. Negative: orbit the north circle counter-clockwise."]
12150 pub major_radius: f32,
12151 #[doc = "Minor axis radius of the figure eight. Defines the radius of two circles that make up the figure."]
12152 pub minor_radius: f32,
12153 #[doc = "Orientation of the figure eight major axis with respect to true north in [-pi,pi)."]
12154 pub orientation: f32,
12155 #[doc = "X coordinate of center point. Coordinate system depends on frame field."]
12156 pub x: i32,
12157 #[doc = "Y coordinate of center point. Coordinate system depends on frame field."]
12158 pub y: i32,
12159 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
12160 pub z: f32,
12161 #[doc = "The coordinate system of the fields: x, y, z."]
12162 pub frame: MavFrame,
12163}
12164impl FIGURE_EIGHT_EXECUTION_STATUS_DATA {
12165 pub const ENCODED_LEN: usize = 33usize;
12166 pub const DEFAULT: Self = Self {
12167 time_usec: 0_u64,
12168 major_radius: 0.0_f32,
12169 minor_radius: 0.0_f32,
12170 orientation: 0.0_f32,
12171 x: 0_i32,
12172 y: 0_i32,
12173 z: 0.0_f32,
12174 frame: MavFrame::DEFAULT,
12175 };
12176 #[cfg(feature = "arbitrary")]
12177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12178 use arbitrary::{Arbitrary, Unstructured};
12179 let mut buf = [0u8; 1024];
12180 rng.fill_bytes(&mut buf);
12181 let mut unstructured = Unstructured::new(&buf);
12182 Self::arbitrary(&mut unstructured).unwrap_or_default()
12183 }
12184}
12185impl Default for FIGURE_EIGHT_EXECUTION_STATUS_DATA {
12186 fn default() -> Self {
12187 Self::DEFAULT.clone()
12188 }
12189}
12190impl MessageData for FIGURE_EIGHT_EXECUTION_STATUS_DATA {
12191 type Message = MavMessage;
12192 const ID: u32 = 361u32;
12193 const NAME: &'static str = "FIGURE_EIGHT_EXECUTION_STATUS";
12194 const EXTRA_CRC: u8 = 93u8;
12195 const ENCODED_LEN: usize = 33usize;
12196 fn deser(
12197 _version: MavlinkVersion,
12198 __input: &[u8],
12199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12200 let avail_len = __input.len();
12201 let mut payload_buf = [0; Self::ENCODED_LEN];
12202 let mut buf = if avail_len < Self::ENCODED_LEN {
12203 payload_buf[0..avail_len].copy_from_slice(__input);
12204 Bytes::new(&payload_buf)
12205 } else {
12206 Bytes::new(__input)
12207 };
12208 let mut __struct = Self::default();
12209 __struct.time_usec = buf.get_u64_le()?;
12210 __struct.major_radius = buf.get_f32_le()?;
12211 __struct.minor_radius = buf.get_f32_le()?;
12212 __struct.orientation = buf.get_f32_le()?;
12213 __struct.x = buf.get_i32_le()?;
12214 __struct.y = buf.get_i32_le()?;
12215 __struct.z = buf.get_f32_le()?;
12216 let tmp = buf.get_u8()?;
12217 __struct.frame =
12218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12219 enum_type: "MavFrame",
12220 value: tmp as u64,
12221 })?;
12222 Ok(__struct)
12223 }
12224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12225 let mut __tmp = BytesMut::new(bytes);
12226 #[allow(clippy::absurd_extreme_comparisons)]
12227 #[allow(unused_comparisons)]
12228 if __tmp.remaining() < Self::ENCODED_LEN {
12229 panic!(
12230 "buffer is too small (need {} bytes, but got {})",
12231 Self::ENCODED_LEN,
12232 __tmp.remaining(),
12233 )
12234 }
12235 __tmp.put_u64_le(self.time_usec);
12236 __tmp.put_f32_le(self.major_radius);
12237 __tmp.put_f32_le(self.minor_radius);
12238 __tmp.put_f32_le(self.orientation);
12239 __tmp.put_i32_le(self.x);
12240 __tmp.put_i32_le(self.y);
12241 __tmp.put_f32_le(self.z);
12242 __tmp.put_u8(self.frame as u8);
12243 if matches!(version, MavlinkVersion::V2) {
12244 let len = __tmp.len();
12245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12246 } else {
12247 __tmp.len()
12248 }
12249 }
12250}
12251#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12252#[doc = ""]
12253#[doc = "ID: 110"]
12254#[derive(Debug, Clone, PartialEq)]
12255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12257#[cfg_attr(feature = "ts", derive(TS))]
12258#[cfg_attr(feature = "ts", ts(export))]
12259pub struct FILE_TRANSFER_PROTOCOL_DATA {
12260 #[doc = "Network ID (0 for broadcast)"]
12261 pub target_network: u8,
12262 #[doc = "System ID (0 for broadcast)"]
12263 pub target_system: u8,
12264 #[doc = "Component ID (0 for broadcast)"]
12265 pub target_component: u8,
12266 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12268 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12269 pub payload: [u8; 251],
12270}
12271impl FILE_TRANSFER_PROTOCOL_DATA {
12272 pub const ENCODED_LEN: usize = 254usize;
12273 pub const DEFAULT: Self = Self {
12274 target_network: 0_u8,
12275 target_system: 0_u8,
12276 target_component: 0_u8,
12277 payload: [0_u8; 251usize],
12278 };
12279 #[cfg(feature = "arbitrary")]
12280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12281 use arbitrary::{Arbitrary, Unstructured};
12282 let mut buf = [0u8; 1024];
12283 rng.fill_bytes(&mut buf);
12284 let mut unstructured = Unstructured::new(&buf);
12285 Self::arbitrary(&mut unstructured).unwrap_or_default()
12286 }
12287}
12288impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12289 fn default() -> Self {
12290 Self::DEFAULT.clone()
12291 }
12292}
12293impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12294 type Message = MavMessage;
12295 const ID: u32 = 110u32;
12296 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12297 const EXTRA_CRC: u8 = 84u8;
12298 const ENCODED_LEN: usize = 254usize;
12299 fn deser(
12300 _version: MavlinkVersion,
12301 __input: &[u8],
12302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12303 let avail_len = __input.len();
12304 let mut payload_buf = [0; Self::ENCODED_LEN];
12305 let mut buf = if avail_len < Self::ENCODED_LEN {
12306 payload_buf[0..avail_len].copy_from_slice(__input);
12307 Bytes::new(&payload_buf)
12308 } else {
12309 Bytes::new(__input)
12310 };
12311 let mut __struct = Self::default();
12312 __struct.target_network = buf.get_u8()?;
12313 __struct.target_system = buf.get_u8()?;
12314 __struct.target_component = buf.get_u8()?;
12315 for v in &mut __struct.payload {
12316 let val = buf.get_u8()?;
12317 *v = val;
12318 }
12319 Ok(__struct)
12320 }
12321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12322 let mut __tmp = BytesMut::new(bytes);
12323 #[allow(clippy::absurd_extreme_comparisons)]
12324 #[allow(unused_comparisons)]
12325 if __tmp.remaining() < Self::ENCODED_LEN {
12326 panic!(
12327 "buffer is too small (need {} bytes, but got {})",
12328 Self::ENCODED_LEN,
12329 __tmp.remaining(),
12330 )
12331 }
12332 __tmp.put_u8(self.target_network);
12333 __tmp.put_u8(self.target_system);
12334 __tmp.put_u8(self.target_component);
12335 for val in &self.payload {
12336 __tmp.put_u8(*val);
12337 }
12338 if matches!(version, MavlinkVersion::V2) {
12339 let len = __tmp.len();
12340 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12341 } else {
12342 __tmp.len()
12343 }
12344 }
12345}
12346#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12347#[doc = ""]
12348#[doc = "ID: 264"]
12349#[derive(Debug, Clone, PartialEq)]
12350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12352#[cfg_attr(feature = "ts", derive(TS))]
12353#[cfg_attr(feature = "ts", ts(export))]
12354pub struct FLIGHT_INFORMATION_DATA {
12355 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12356 pub arming_time_utc: u64,
12357 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12358 pub takeoff_time_utc: u64,
12359 #[doc = "Flight number. Note, field is misnamed UUID."]
12360 pub flight_uuid: u64,
12361 #[doc = "Timestamp (time since system boot)."]
12362 pub time_boot_ms: u32,
12363 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12365 pub landing_time: u32,
12366}
12367impl FLIGHT_INFORMATION_DATA {
12368 pub const ENCODED_LEN: usize = 32usize;
12369 pub const DEFAULT: Self = Self {
12370 arming_time_utc: 0_u64,
12371 takeoff_time_utc: 0_u64,
12372 flight_uuid: 0_u64,
12373 time_boot_ms: 0_u32,
12374 landing_time: 0_u32,
12375 };
12376 #[cfg(feature = "arbitrary")]
12377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12378 use arbitrary::{Arbitrary, Unstructured};
12379 let mut buf = [0u8; 1024];
12380 rng.fill_bytes(&mut buf);
12381 let mut unstructured = Unstructured::new(&buf);
12382 Self::arbitrary(&mut unstructured).unwrap_or_default()
12383 }
12384}
12385impl Default for FLIGHT_INFORMATION_DATA {
12386 fn default() -> Self {
12387 Self::DEFAULT.clone()
12388 }
12389}
12390impl MessageData for FLIGHT_INFORMATION_DATA {
12391 type Message = MavMessage;
12392 const ID: u32 = 264u32;
12393 const NAME: &'static str = "FLIGHT_INFORMATION";
12394 const EXTRA_CRC: u8 = 49u8;
12395 const ENCODED_LEN: usize = 32usize;
12396 fn deser(
12397 _version: MavlinkVersion,
12398 __input: &[u8],
12399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12400 let avail_len = __input.len();
12401 let mut payload_buf = [0; Self::ENCODED_LEN];
12402 let mut buf = if avail_len < Self::ENCODED_LEN {
12403 payload_buf[0..avail_len].copy_from_slice(__input);
12404 Bytes::new(&payload_buf)
12405 } else {
12406 Bytes::new(__input)
12407 };
12408 let mut __struct = Self::default();
12409 __struct.arming_time_utc = buf.get_u64_le()?;
12410 __struct.takeoff_time_utc = buf.get_u64_le()?;
12411 __struct.flight_uuid = buf.get_u64_le()?;
12412 __struct.time_boot_ms = buf.get_u32_le()?;
12413 __struct.landing_time = buf.get_u32_le()?;
12414 Ok(__struct)
12415 }
12416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12417 let mut __tmp = BytesMut::new(bytes);
12418 #[allow(clippy::absurd_extreme_comparisons)]
12419 #[allow(unused_comparisons)]
12420 if __tmp.remaining() < Self::ENCODED_LEN {
12421 panic!(
12422 "buffer is too small (need {} bytes, but got {})",
12423 Self::ENCODED_LEN,
12424 __tmp.remaining(),
12425 )
12426 }
12427 __tmp.put_u64_le(self.arming_time_utc);
12428 __tmp.put_u64_le(self.takeoff_time_utc);
12429 __tmp.put_u64_le(self.flight_uuid);
12430 __tmp.put_u32_le(self.time_boot_ms);
12431 if matches!(version, MavlinkVersion::V2) {
12432 __tmp.put_u32_le(self.landing_time);
12433 let len = __tmp.len();
12434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12435 } else {
12436 __tmp.len()
12437 }
12438 }
12439}
12440#[doc = "Current motion information from a designated system."]
12441#[doc = ""]
12442#[doc = "ID: 144"]
12443#[derive(Debug, Clone, PartialEq)]
12444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12446#[cfg_attr(feature = "ts", derive(TS))]
12447#[cfg_attr(feature = "ts", ts(export))]
12448pub struct FOLLOW_TARGET_DATA {
12449 #[doc = "Timestamp (time since system boot)."]
12450 pub timestamp: u64,
12451 #[doc = "button states or switches of a tracker device"]
12452 pub custom_state: u64,
12453 #[doc = "Latitude (WGS84)"]
12454 pub lat: i32,
12455 #[doc = "Longitude (WGS84)"]
12456 pub lon: i32,
12457 #[doc = "Altitude (MSL)"]
12458 pub alt: f32,
12459 #[doc = "target velocity (0,0,0) for unknown"]
12460 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12461 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12462 pub vel: [f32; 3],
12463 #[doc = "linear target acceleration (0,0,0) for unknown"]
12464 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12465 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12466 pub acc: [f32; 3],
12467 #[doc = "(0 0 0 0 for unknown)"]
12468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12469 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12470 pub attitude_q: [f32; 4],
12471 #[doc = "(0 0 0 for unknown)"]
12472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12473 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12474 pub rates: [f32; 3],
12475 #[doc = "eph epv"]
12476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12477 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12478 pub position_cov: [f32; 3],
12479 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12480 pub est_capabilities: u8,
12481}
12482impl FOLLOW_TARGET_DATA {
12483 pub const ENCODED_LEN: usize = 93usize;
12484 pub const DEFAULT: Self = Self {
12485 timestamp: 0_u64,
12486 custom_state: 0_u64,
12487 lat: 0_i32,
12488 lon: 0_i32,
12489 alt: 0.0_f32,
12490 vel: [0.0_f32; 3usize],
12491 acc: [0.0_f32; 3usize],
12492 attitude_q: [0.0_f32; 4usize],
12493 rates: [0.0_f32; 3usize],
12494 position_cov: [0.0_f32; 3usize],
12495 est_capabilities: 0_u8,
12496 };
12497 #[cfg(feature = "arbitrary")]
12498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12499 use arbitrary::{Arbitrary, Unstructured};
12500 let mut buf = [0u8; 1024];
12501 rng.fill_bytes(&mut buf);
12502 let mut unstructured = Unstructured::new(&buf);
12503 Self::arbitrary(&mut unstructured).unwrap_or_default()
12504 }
12505}
12506impl Default for FOLLOW_TARGET_DATA {
12507 fn default() -> Self {
12508 Self::DEFAULT.clone()
12509 }
12510}
12511impl MessageData for FOLLOW_TARGET_DATA {
12512 type Message = MavMessage;
12513 const ID: u32 = 144u32;
12514 const NAME: &'static str = "FOLLOW_TARGET";
12515 const EXTRA_CRC: u8 = 127u8;
12516 const ENCODED_LEN: usize = 93usize;
12517 fn deser(
12518 _version: MavlinkVersion,
12519 __input: &[u8],
12520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12521 let avail_len = __input.len();
12522 let mut payload_buf = [0; Self::ENCODED_LEN];
12523 let mut buf = if avail_len < Self::ENCODED_LEN {
12524 payload_buf[0..avail_len].copy_from_slice(__input);
12525 Bytes::new(&payload_buf)
12526 } else {
12527 Bytes::new(__input)
12528 };
12529 let mut __struct = Self::default();
12530 __struct.timestamp = buf.get_u64_le()?;
12531 __struct.custom_state = buf.get_u64_le()?;
12532 __struct.lat = buf.get_i32_le()?;
12533 __struct.lon = buf.get_i32_le()?;
12534 __struct.alt = buf.get_f32_le()?;
12535 for v in &mut __struct.vel {
12536 let val = buf.get_f32_le()?;
12537 *v = val;
12538 }
12539 for v in &mut __struct.acc {
12540 let val = buf.get_f32_le()?;
12541 *v = val;
12542 }
12543 for v in &mut __struct.attitude_q {
12544 let val = buf.get_f32_le()?;
12545 *v = val;
12546 }
12547 for v in &mut __struct.rates {
12548 let val = buf.get_f32_le()?;
12549 *v = val;
12550 }
12551 for v in &mut __struct.position_cov {
12552 let val = buf.get_f32_le()?;
12553 *v = val;
12554 }
12555 __struct.est_capabilities = buf.get_u8()?;
12556 Ok(__struct)
12557 }
12558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12559 let mut __tmp = BytesMut::new(bytes);
12560 #[allow(clippy::absurd_extreme_comparisons)]
12561 #[allow(unused_comparisons)]
12562 if __tmp.remaining() < Self::ENCODED_LEN {
12563 panic!(
12564 "buffer is too small (need {} bytes, but got {})",
12565 Self::ENCODED_LEN,
12566 __tmp.remaining(),
12567 )
12568 }
12569 __tmp.put_u64_le(self.timestamp);
12570 __tmp.put_u64_le(self.custom_state);
12571 __tmp.put_i32_le(self.lat);
12572 __tmp.put_i32_le(self.lon);
12573 __tmp.put_f32_le(self.alt);
12574 for val in &self.vel {
12575 __tmp.put_f32_le(*val);
12576 }
12577 for val in &self.acc {
12578 __tmp.put_f32_le(*val);
12579 }
12580 for val in &self.attitude_q {
12581 __tmp.put_f32_le(*val);
12582 }
12583 for val in &self.rates {
12584 __tmp.put_f32_le(*val);
12585 }
12586 for val in &self.position_cov {
12587 __tmp.put_f32_le(*val);
12588 }
12589 __tmp.put_u8(self.est_capabilities);
12590 if matches!(version, MavlinkVersion::V2) {
12591 let len = __tmp.len();
12592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12593 } else {
12594 __tmp.len()
12595 }
12596 }
12597}
12598#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12599#[doc = ""]
12600#[doc = "ID: 371"]
12601#[derive(Debug, Clone, PartialEq)]
12602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12604#[cfg_attr(feature = "ts", derive(TS))]
12605#[cfg_attr(feature = "ts", ts(export))]
12606pub struct FUEL_STATUS_DATA {
12607 #[doc = "Capacity when full. Must be provided."]
12608 pub maximum_fuel: f32,
12609 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12610 pub consumed_fuel: f32,
12611 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12612 pub remaining_fuel: f32,
12613 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12614 pub flow_rate: f32,
12615 #[doc = "Fuel temperature. NaN: field not provided."]
12616 pub temperature: f32,
12617 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12618 pub fuel_type: MavFuelType,
12619 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12620 pub id: u8,
12621 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12622 pub percent_remaining: u8,
12623}
12624impl FUEL_STATUS_DATA {
12625 pub const ENCODED_LEN: usize = 26usize;
12626 pub const DEFAULT: Self = Self {
12627 maximum_fuel: 0.0_f32,
12628 consumed_fuel: 0.0_f32,
12629 remaining_fuel: 0.0_f32,
12630 flow_rate: 0.0_f32,
12631 temperature: 0.0_f32,
12632 fuel_type: MavFuelType::DEFAULT,
12633 id: 0_u8,
12634 percent_remaining: 0_u8,
12635 };
12636 #[cfg(feature = "arbitrary")]
12637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12638 use arbitrary::{Arbitrary, Unstructured};
12639 let mut buf = [0u8; 1024];
12640 rng.fill_bytes(&mut buf);
12641 let mut unstructured = Unstructured::new(&buf);
12642 Self::arbitrary(&mut unstructured).unwrap_or_default()
12643 }
12644}
12645impl Default for FUEL_STATUS_DATA {
12646 fn default() -> Self {
12647 Self::DEFAULT.clone()
12648 }
12649}
12650impl MessageData for FUEL_STATUS_DATA {
12651 type Message = MavMessage;
12652 const ID: u32 = 371u32;
12653 const NAME: &'static str = "FUEL_STATUS";
12654 const EXTRA_CRC: u8 = 10u8;
12655 const ENCODED_LEN: usize = 26usize;
12656 fn deser(
12657 _version: MavlinkVersion,
12658 __input: &[u8],
12659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12660 let avail_len = __input.len();
12661 let mut payload_buf = [0; Self::ENCODED_LEN];
12662 let mut buf = if avail_len < Self::ENCODED_LEN {
12663 payload_buf[0..avail_len].copy_from_slice(__input);
12664 Bytes::new(&payload_buf)
12665 } else {
12666 Bytes::new(__input)
12667 };
12668 let mut __struct = Self::default();
12669 __struct.maximum_fuel = buf.get_f32_le()?;
12670 __struct.consumed_fuel = buf.get_f32_le()?;
12671 __struct.remaining_fuel = buf.get_f32_le()?;
12672 __struct.flow_rate = buf.get_f32_le()?;
12673 __struct.temperature = buf.get_f32_le()?;
12674 let tmp = buf.get_u32_le()?;
12675 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12676 ::mavlink_core::error::ParserError::InvalidEnum {
12677 enum_type: "MavFuelType",
12678 value: tmp as u64,
12679 },
12680 )?;
12681 __struct.id = buf.get_u8()?;
12682 __struct.percent_remaining = buf.get_u8()?;
12683 Ok(__struct)
12684 }
12685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12686 let mut __tmp = BytesMut::new(bytes);
12687 #[allow(clippy::absurd_extreme_comparisons)]
12688 #[allow(unused_comparisons)]
12689 if __tmp.remaining() < Self::ENCODED_LEN {
12690 panic!(
12691 "buffer is too small (need {} bytes, but got {})",
12692 Self::ENCODED_LEN,
12693 __tmp.remaining(),
12694 )
12695 }
12696 __tmp.put_f32_le(self.maximum_fuel);
12697 __tmp.put_f32_le(self.consumed_fuel);
12698 __tmp.put_f32_le(self.remaining_fuel);
12699 __tmp.put_f32_le(self.flow_rate);
12700 __tmp.put_f32_le(self.temperature);
12701 __tmp.put_u32_le(self.fuel_type as u32);
12702 __tmp.put_u8(self.id);
12703 __tmp.put_u8(self.percent_remaining);
12704 if matches!(version, MavlinkVersion::V2) {
12705 let len = __tmp.len();
12706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12707 } else {
12708 __tmp.len()
12709 }
12710 }
12711}
12712#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12713#[doc = ""]
12714#[doc = "ID: 373"]
12715#[derive(Debug, Clone, PartialEq)]
12716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12718#[cfg_attr(feature = "ts", derive(TS))]
12719#[cfg_attr(feature = "ts", ts(export))]
12720pub struct GENERATOR_STATUS_DATA {
12721 #[doc = "Status flags."]
12722 pub status: MavGeneratorStatusFlag,
12723 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12724 pub battery_current: f32,
12725 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12726 pub load_current: f32,
12727 #[doc = "The power being generated. NaN: field not provided"]
12728 pub power_generated: f32,
12729 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12730 pub bus_voltage: f32,
12731 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12732 pub bat_current_setpoint: f32,
12733 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12734 pub runtime: u32,
12735 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12736 pub time_until_maintenance: i32,
12737 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12738 pub generator_speed: u16,
12739 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12740 pub rectifier_temperature: i16,
12741 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12742 pub generator_temperature: i16,
12743}
12744impl GENERATOR_STATUS_DATA {
12745 pub const ENCODED_LEN: usize = 42usize;
12746 pub const DEFAULT: Self = Self {
12747 status: MavGeneratorStatusFlag::DEFAULT,
12748 battery_current: 0.0_f32,
12749 load_current: 0.0_f32,
12750 power_generated: 0.0_f32,
12751 bus_voltage: 0.0_f32,
12752 bat_current_setpoint: 0.0_f32,
12753 runtime: 0_u32,
12754 time_until_maintenance: 0_i32,
12755 generator_speed: 0_u16,
12756 rectifier_temperature: 0_i16,
12757 generator_temperature: 0_i16,
12758 };
12759 #[cfg(feature = "arbitrary")]
12760 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12761 use arbitrary::{Arbitrary, Unstructured};
12762 let mut buf = [0u8; 1024];
12763 rng.fill_bytes(&mut buf);
12764 let mut unstructured = Unstructured::new(&buf);
12765 Self::arbitrary(&mut unstructured).unwrap_or_default()
12766 }
12767}
12768impl Default for GENERATOR_STATUS_DATA {
12769 fn default() -> Self {
12770 Self::DEFAULT.clone()
12771 }
12772}
12773impl MessageData for GENERATOR_STATUS_DATA {
12774 type Message = MavMessage;
12775 const ID: u32 = 373u32;
12776 const NAME: &'static str = "GENERATOR_STATUS";
12777 const EXTRA_CRC: u8 = 117u8;
12778 const ENCODED_LEN: usize = 42usize;
12779 fn deser(
12780 _version: MavlinkVersion,
12781 __input: &[u8],
12782 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12783 let avail_len = __input.len();
12784 let mut payload_buf = [0; Self::ENCODED_LEN];
12785 let mut buf = if avail_len < Self::ENCODED_LEN {
12786 payload_buf[0..avail_len].copy_from_slice(__input);
12787 Bytes::new(&payload_buf)
12788 } else {
12789 Bytes::new(__input)
12790 };
12791 let mut __struct = Self::default();
12792 let tmp = buf.get_u64_le()?;
12793 __struct.status =
12794 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
12795 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12796 flag_type: "MavGeneratorStatusFlag",
12797 value: tmp as u64,
12798 })?;
12799 __struct.battery_current = buf.get_f32_le()?;
12800 __struct.load_current = buf.get_f32_le()?;
12801 __struct.power_generated = buf.get_f32_le()?;
12802 __struct.bus_voltage = buf.get_f32_le()?;
12803 __struct.bat_current_setpoint = buf.get_f32_le()?;
12804 __struct.runtime = buf.get_u32_le()?;
12805 __struct.time_until_maintenance = buf.get_i32_le()?;
12806 __struct.generator_speed = buf.get_u16_le()?;
12807 __struct.rectifier_temperature = buf.get_i16_le()?;
12808 __struct.generator_temperature = buf.get_i16_le()?;
12809 Ok(__struct)
12810 }
12811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12812 let mut __tmp = BytesMut::new(bytes);
12813 #[allow(clippy::absurd_extreme_comparisons)]
12814 #[allow(unused_comparisons)]
12815 if __tmp.remaining() < Self::ENCODED_LEN {
12816 panic!(
12817 "buffer is too small (need {} bytes, but got {})",
12818 Self::ENCODED_LEN,
12819 __tmp.remaining(),
12820 )
12821 }
12822 __tmp.put_u64_le(self.status.bits() as u64);
12823 __tmp.put_f32_le(self.battery_current);
12824 __tmp.put_f32_le(self.load_current);
12825 __tmp.put_f32_le(self.power_generated);
12826 __tmp.put_f32_le(self.bus_voltage);
12827 __tmp.put_f32_le(self.bat_current_setpoint);
12828 __tmp.put_u32_le(self.runtime);
12829 __tmp.put_i32_le(self.time_until_maintenance);
12830 __tmp.put_u16_le(self.generator_speed);
12831 __tmp.put_i16_le(self.rectifier_temperature);
12832 __tmp.put_i16_le(self.generator_temperature);
12833 if matches!(version, MavlinkVersion::V2) {
12834 let len = __tmp.len();
12835 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12836 } else {
12837 __tmp.len()
12838 }
12839 }
12840}
12841#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12842#[doc = ""]
12843#[doc = "ID: 285"]
12844#[derive(Debug, Clone, PartialEq)]
12845#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12847#[cfg_attr(feature = "ts", derive(TS))]
12848#[cfg_attr(feature = "ts", ts(export))]
12849pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12850 #[doc = "Timestamp (time since system boot)."]
12851 pub time_boot_ms: u32,
12852 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12854 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12855 pub q: [f32; 4],
12856 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12857 pub angular_velocity_x: f32,
12858 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12859 pub angular_velocity_y: f32,
12860 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12861 pub angular_velocity_z: f32,
12862 #[doc = "Failure flags (0 for no failure)"]
12863 pub failure_flags: GimbalDeviceErrorFlags,
12864 #[doc = "Current gimbal flags set."]
12865 pub flags: GimbalDeviceFlags,
12866 #[doc = "System ID"]
12867 pub target_system: u8,
12868 #[doc = "Component ID"]
12869 pub target_component: u8,
12870 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12871 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12872 pub delta_yaw: f32,
12873 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12874 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12875 pub delta_yaw_velocity: f32,
12876 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12878 pub gimbal_device_id: u8,
12879}
12880impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12881 pub const ENCODED_LEN: usize = 49usize;
12882 pub const DEFAULT: Self = Self {
12883 time_boot_ms: 0_u32,
12884 q: [0.0_f32; 4usize],
12885 angular_velocity_x: 0.0_f32,
12886 angular_velocity_y: 0.0_f32,
12887 angular_velocity_z: 0.0_f32,
12888 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12889 flags: GimbalDeviceFlags::DEFAULT,
12890 target_system: 0_u8,
12891 target_component: 0_u8,
12892 delta_yaw: 0.0_f32,
12893 delta_yaw_velocity: 0.0_f32,
12894 gimbal_device_id: 0_u8,
12895 };
12896 #[cfg(feature = "arbitrary")]
12897 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12898 use arbitrary::{Arbitrary, Unstructured};
12899 let mut buf = [0u8; 1024];
12900 rng.fill_bytes(&mut buf);
12901 let mut unstructured = Unstructured::new(&buf);
12902 Self::arbitrary(&mut unstructured).unwrap_or_default()
12903 }
12904}
12905impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12906 fn default() -> Self {
12907 Self::DEFAULT.clone()
12908 }
12909}
12910impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12911 type Message = MavMessage;
12912 const ID: u32 = 285u32;
12913 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12914 const EXTRA_CRC: u8 = 137u8;
12915 const ENCODED_LEN: usize = 49usize;
12916 fn deser(
12917 _version: MavlinkVersion,
12918 __input: &[u8],
12919 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12920 let avail_len = __input.len();
12921 let mut payload_buf = [0; Self::ENCODED_LEN];
12922 let mut buf = if avail_len < Self::ENCODED_LEN {
12923 payload_buf[0..avail_len].copy_from_slice(__input);
12924 Bytes::new(&payload_buf)
12925 } else {
12926 Bytes::new(__input)
12927 };
12928 let mut __struct = Self::default();
12929 __struct.time_boot_ms = buf.get_u32_le()?;
12930 for v in &mut __struct.q {
12931 let val = buf.get_f32_le()?;
12932 *v = val;
12933 }
12934 __struct.angular_velocity_x = buf.get_f32_le()?;
12935 __struct.angular_velocity_y = buf.get_f32_le()?;
12936 __struct.angular_velocity_z = buf.get_f32_le()?;
12937 let tmp = buf.get_u32_le()?;
12938 __struct.failure_flags =
12939 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
12940 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12941 flag_type: "GimbalDeviceErrorFlags",
12942 value: tmp as u64,
12943 })?;
12944 let tmp = buf.get_u16_le()?;
12945 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12946 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12947 flag_type: "GimbalDeviceFlags",
12948 value: tmp as u64,
12949 })?;
12950 __struct.target_system = buf.get_u8()?;
12951 __struct.target_component = buf.get_u8()?;
12952 __struct.delta_yaw = buf.get_f32_le()?;
12953 __struct.delta_yaw_velocity = buf.get_f32_le()?;
12954 __struct.gimbal_device_id = buf.get_u8()?;
12955 Ok(__struct)
12956 }
12957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12958 let mut __tmp = BytesMut::new(bytes);
12959 #[allow(clippy::absurd_extreme_comparisons)]
12960 #[allow(unused_comparisons)]
12961 if __tmp.remaining() < Self::ENCODED_LEN {
12962 panic!(
12963 "buffer is too small (need {} bytes, but got {})",
12964 Self::ENCODED_LEN,
12965 __tmp.remaining(),
12966 )
12967 }
12968 __tmp.put_u32_le(self.time_boot_ms);
12969 for val in &self.q {
12970 __tmp.put_f32_le(*val);
12971 }
12972 __tmp.put_f32_le(self.angular_velocity_x);
12973 __tmp.put_f32_le(self.angular_velocity_y);
12974 __tmp.put_f32_le(self.angular_velocity_z);
12975 __tmp.put_u32_le(self.failure_flags.bits() as u32);
12976 __tmp.put_u16_le(self.flags.bits() as u16);
12977 __tmp.put_u8(self.target_system);
12978 __tmp.put_u8(self.target_component);
12979 if matches!(version, MavlinkVersion::V2) {
12980 __tmp.put_f32_le(self.delta_yaw);
12981 __tmp.put_f32_le(self.delta_yaw_velocity);
12982 __tmp.put_u8(self.gimbal_device_id);
12983 let len = __tmp.len();
12984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12985 } else {
12986 __tmp.len()
12987 }
12988 }
12989}
12990#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12991#[doc = ""]
12992#[doc = "ID: 283"]
12993#[derive(Debug, Clone, PartialEq)]
12994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12996#[cfg_attr(feature = "ts", derive(TS))]
12997#[cfg_attr(feature = "ts", ts(export))]
12998pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12999 #[doc = "UID of gimbal hardware (0 if unknown)."]
13000 pub uid: u64,
13001 #[doc = "Timestamp (time since system boot)."]
13002 pub time_boot_ms: u32,
13003 #[doc = "0xff)."]
13004 pub firmware_version: u32,
13005 #[doc = "0xff)."]
13006 pub hardware_version: u32,
13007 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13008 pub roll_min: f32,
13009 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13010 pub roll_max: f32,
13011 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13012 pub pitch_min: f32,
13013 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13014 pub pitch_max: f32,
13015 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13016 pub yaw_min: f32,
13017 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13018 pub yaw_max: f32,
13019 #[doc = "Bitmap of gimbal capability flags."]
13020 pub cap_flags: GimbalDeviceCapFlags,
13021 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13022 pub custom_cap_flags: u16,
13023 #[doc = "Name of the gimbal vendor."]
13024 #[cfg_attr(feature = "ts", ts(type = "string"))]
13025 pub vendor_name: CharArray<32>,
13026 #[doc = "Name of the gimbal model."]
13027 #[cfg_attr(feature = "ts", ts(type = "string"))]
13028 pub model_name: CharArray<32>,
13029 #[doc = "Custom name of the gimbal given to it by the user."]
13030 #[cfg_attr(feature = "ts", ts(type = "string"))]
13031 pub custom_name: CharArray<32>,
13032 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13034 pub gimbal_device_id: u8,
13035}
13036impl GIMBAL_DEVICE_INFORMATION_DATA {
13037 pub const ENCODED_LEN: usize = 145usize;
13038 pub const DEFAULT: Self = Self {
13039 uid: 0_u64,
13040 time_boot_ms: 0_u32,
13041 firmware_version: 0_u32,
13042 hardware_version: 0_u32,
13043 roll_min: 0.0_f32,
13044 roll_max: 0.0_f32,
13045 pitch_min: 0.0_f32,
13046 pitch_max: 0.0_f32,
13047 yaw_min: 0.0_f32,
13048 yaw_max: 0.0_f32,
13049 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13050 custom_cap_flags: 0_u16,
13051 vendor_name: CharArray::new([0_u8; 32usize]),
13052 model_name: CharArray::new([0_u8; 32usize]),
13053 custom_name: CharArray::new([0_u8; 32usize]),
13054 gimbal_device_id: 0_u8,
13055 };
13056 #[cfg(feature = "arbitrary")]
13057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13058 use arbitrary::{Arbitrary, Unstructured};
13059 let mut buf = [0u8; 1024];
13060 rng.fill_bytes(&mut buf);
13061 let mut unstructured = Unstructured::new(&buf);
13062 Self::arbitrary(&mut unstructured).unwrap_or_default()
13063 }
13064}
13065impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13066 fn default() -> Self {
13067 Self::DEFAULT.clone()
13068 }
13069}
13070impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13071 type Message = MavMessage;
13072 const ID: u32 = 283u32;
13073 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13074 const EXTRA_CRC: u8 = 74u8;
13075 const ENCODED_LEN: usize = 145usize;
13076 fn deser(
13077 _version: MavlinkVersion,
13078 __input: &[u8],
13079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13080 let avail_len = __input.len();
13081 let mut payload_buf = [0; Self::ENCODED_LEN];
13082 let mut buf = if avail_len < Self::ENCODED_LEN {
13083 payload_buf[0..avail_len].copy_from_slice(__input);
13084 Bytes::new(&payload_buf)
13085 } else {
13086 Bytes::new(__input)
13087 };
13088 let mut __struct = Self::default();
13089 __struct.uid = buf.get_u64_le()?;
13090 __struct.time_boot_ms = buf.get_u32_le()?;
13091 __struct.firmware_version = buf.get_u32_le()?;
13092 __struct.hardware_version = buf.get_u32_le()?;
13093 __struct.roll_min = buf.get_f32_le()?;
13094 __struct.roll_max = buf.get_f32_le()?;
13095 __struct.pitch_min = buf.get_f32_le()?;
13096 __struct.pitch_max = buf.get_f32_le()?;
13097 __struct.yaw_min = buf.get_f32_le()?;
13098 __struct.yaw_max = buf.get_f32_le()?;
13099 let tmp = buf.get_u16_le()?;
13100 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13101 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
13102 )
13103 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13104 flag_type: "GimbalDeviceCapFlags",
13105 value: tmp as u64,
13106 })?;
13107 __struct.custom_cap_flags = buf.get_u16_le()?;
13108 let mut tmp = [0_u8; 32usize];
13109 for v in &mut tmp {
13110 *v = buf.get_u8()?;
13111 }
13112 __struct.vendor_name = CharArray::new(tmp);
13113 let mut tmp = [0_u8; 32usize];
13114 for v in &mut tmp {
13115 *v = buf.get_u8()?;
13116 }
13117 __struct.model_name = CharArray::new(tmp);
13118 let mut tmp = [0_u8; 32usize];
13119 for v in &mut tmp {
13120 *v = buf.get_u8()?;
13121 }
13122 __struct.custom_name = CharArray::new(tmp);
13123 __struct.gimbal_device_id = buf.get_u8()?;
13124 Ok(__struct)
13125 }
13126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13127 let mut __tmp = BytesMut::new(bytes);
13128 #[allow(clippy::absurd_extreme_comparisons)]
13129 #[allow(unused_comparisons)]
13130 if __tmp.remaining() < Self::ENCODED_LEN {
13131 panic!(
13132 "buffer is too small (need {} bytes, but got {})",
13133 Self::ENCODED_LEN,
13134 __tmp.remaining(),
13135 )
13136 }
13137 __tmp.put_u64_le(self.uid);
13138 __tmp.put_u32_le(self.time_boot_ms);
13139 __tmp.put_u32_le(self.firmware_version);
13140 __tmp.put_u32_le(self.hardware_version);
13141 __tmp.put_f32_le(self.roll_min);
13142 __tmp.put_f32_le(self.roll_max);
13143 __tmp.put_f32_le(self.pitch_min);
13144 __tmp.put_f32_le(self.pitch_max);
13145 __tmp.put_f32_le(self.yaw_min);
13146 __tmp.put_f32_le(self.yaw_max);
13147 __tmp.put_u16_le(self.cap_flags.bits() as u16);
13148 __tmp.put_u16_le(self.custom_cap_flags);
13149 for val in &self.vendor_name {
13150 __tmp.put_u8(*val);
13151 }
13152 for val in &self.model_name {
13153 __tmp.put_u8(*val);
13154 }
13155 for val in &self.custom_name {
13156 __tmp.put_u8(*val);
13157 }
13158 if matches!(version, MavlinkVersion::V2) {
13159 __tmp.put_u8(self.gimbal_device_id);
13160 let len = __tmp.len();
13161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13162 } else {
13163 __tmp.len()
13164 }
13165 }
13166}
13167#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13168#[doc = ""]
13169#[doc = "ID: 284"]
13170#[derive(Debug, Clone, PartialEq)]
13171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13173#[cfg_attr(feature = "ts", derive(TS))]
13174#[cfg_attr(feature = "ts", ts(export))]
13175pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13176 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13177 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13178 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13179 pub q: [f32; 4],
13180 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13181 pub angular_velocity_x: f32,
13182 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13183 pub angular_velocity_y: f32,
13184 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13185 pub angular_velocity_z: f32,
13186 #[doc = "Low level gimbal flags."]
13187 pub flags: GimbalDeviceFlags,
13188 #[doc = "System ID"]
13189 pub target_system: u8,
13190 #[doc = "Component ID"]
13191 pub target_component: u8,
13192}
13193impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13194 pub const ENCODED_LEN: usize = 32usize;
13195 pub const DEFAULT: Self = Self {
13196 q: [0.0_f32; 4usize],
13197 angular_velocity_x: 0.0_f32,
13198 angular_velocity_y: 0.0_f32,
13199 angular_velocity_z: 0.0_f32,
13200 flags: GimbalDeviceFlags::DEFAULT,
13201 target_system: 0_u8,
13202 target_component: 0_u8,
13203 };
13204 #[cfg(feature = "arbitrary")]
13205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13206 use arbitrary::{Arbitrary, Unstructured};
13207 let mut buf = [0u8; 1024];
13208 rng.fill_bytes(&mut buf);
13209 let mut unstructured = Unstructured::new(&buf);
13210 Self::arbitrary(&mut unstructured).unwrap_or_default()
13211 }
13212}
13213impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13214 fn default() -> Self {
13215 Self::DEFAULT.clone()
13216 }
13217}
13218impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13219 type Message = MavMessage;
13220 const ID: u32 = 284u32;
13221 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13222 const EXTRA_CRC: u8 = 99u8;
13223 const ENCODED_LEN: usize = 32usize;
13224 fn deser(
13225 _version: MavlinkVersion,
13226 __input: &[u8],
13227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13228 let avail_len = __input.len();
13229 let mut payload_buf = [0; Self::ENCODED_LEN];
13230 let mut buf = if avail_len < Self::ENCODED_LEN {
13231 payload_buf[0..avail_len].copy_from_slice(__input);
13232 Bytes::new(&payload_buf)
13233 } else {
13234 Bytes::new(__input)
13235 };
13236 let mut __struct = Self::default();
13237 for v in &mut __struct.q {
13238 let val = buf.get_f32_le()?;
13239 *v = val;
13240 }
13241 __struct.angular_velocity_x = buf.get_f32_le()?;
13242 __struct.angular_velocity_y = buf.get_f32_le()?;
13243 __struct.angular_velocity_z = buf.get_f32_le()?;
13244 let tmp = buf.get_u16_le()?;
13245 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
13246 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13247 flag_type: "GimbalDeviceFlags",
13248 value: tmp as u64,
13249 })?;
13250 __struct.target_system = buf.get_u8()?;
13251 __struct.target_component = buf.get_u8()?;
13252 Ok(__struct)
13253 }
13254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13255 let mut __tmp = BytesMut::new(bytes);
13256 #[allow(clippy::absurd_extreme_comparisons)]
13257 #[allow(unused_comparisons)]
13258 if __tmp.remaining() < Self::ENCODED_LEN {
13259 panic!(
13260 "buffer is too small (need {} bytes, but got {})",
13261 Self::ENCODED_LEN,
13262 __tmp.remaining(),
13263 )
13264 }
13265 for val in &self.q {
13266 __tmp.put_f32_le(*val);
13267 }
13268 __tmp.put_f32_le(self.angular_velocity_x);
13269 __tmp.put_f32_le(self.angular_velocity_y);
13270 __tmp.put_f32_le(self.angular_velocity_z);
13271 __tmp.put_u16_le(self.flags.bits() as u16);
13272 __tmp.put_u8(self.target_system);
13273 __tmp.put_u8(self.target_component);
13274 if matches!(version, MavlinkVersion::V2) {
13275 let len = __tmp.len();
13276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13277 } else {
13278 __tmp.len()
13279 }
13280 }
13281}
13282#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13283#[doc = ""]
13284#[doc = "ID: 280"]
13285#[derive(Debug, Clone, PartialEq)]
13286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13288#[cfg_attr(feature = "ts", derive(TS))]
13289#[cfg_attr(feature = "ts", ts(export))]
13290pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13291 #[doc = "Timestamp (time since system boot)."]
13292 pub time_boot_ms: u32,
13293 #[doc = "Bitmap of gimbal capability flags."]
13294 pub cap_flags: GimbalManagerCapFlags,
13295 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13296 pub roll_min: f32,
13297 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13298 pub roll_max: f32,
13299 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13300 pub pitch_min: f32,
13301 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13302 pub pitch_max: f32,
13303 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13304 pub yaw_min: f32,
13305 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13306 pub yaw_max: f32,
13307 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13308 pub gimbal_device_id: u8,
13309}
13310impl GIMBAL_MANAGER_INFORMATION_DATA {
13311 pub const ENCODED_LEN: usize = 33usize;
13312 pub const DEFAULT: Self = Self {
13313 time_boot_ms: 0_u32,
13314 cap_flags: GimbalManagerCapFlags::DEFAULT,
13315 roll_min: 0.0_f32,
13316 roll_max: 0.0_f32,
13317 pitch_min: 0.0_f32,
13318 pitch_max: 0.0_f32,
13319 yaw_min: 0.0_f32,
13320 yaw_max: 0.0_f32,
13321 gimbal_device_id: 0_u8,
13322 };
13323 #[cfg(feature = "arbitrary")]
13324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13325 use arbitrary::{Arbitrary, Unstructured};
13326 let mut buf = [0u8; 1024];
13327 rng.fill_bytes(&mut buf);
13328 let mut unstructured = Unstructured::new(&buf);
13329 Self::arbitrary(&mut unstructured).unwrap_or_default()
13330 }
13331}
13332impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13333 fn default() -> Self {
13334 Self::DEFAULT.clone()
13335 }
13336}
13337impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13338 type Message = MavMessage;
13339 const ID: u32 = 280u32;
13340 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13341 const EXTRA_CRC: u8 = 70u8;
13342 const ENCODED_LEN: usize = 33usize;
13343 fn deser(
13344 _version: MavlinkVersion,
13345 __input: &[u8],
13346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13347 let avail_len = __input.len();
13348 let mut payload_buf = [0; Self::ENCODED_LEN];
13349 let mut buf = if avail_len < Self::ENCODED_LEN {
13350 payload_buf[0..avail_len].copy_from_slice(__input);
13351 Bytes::new(&payload_buf)
13352 } else {
13353 Bytes::new(__input)
13354 };
13355 let mut __struct = Self::default();
13356 __struct.time_boot_ms = buf.get_u32_le()?;
13357 let tmp = buf.get_u32_le()?;
13358 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13359 tmp as <GimbalManagerCapFlags as Flags>::Bits,
13360 )
13361 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13362 flag_type: "GimbalManagerCapFlags",
13363 value: tmp as u64,
13364 })?;
13365 __struct.roll_min = buf.get_f32_le()?;
13366 __struct.roll_max = buf.get_f32_le()?;
13367 __struct.pitch_min = buf.get_f32_le()?;
13368 __struct.pitch_max = buf.get_f32_le()?;
13369 __struct.yaw_min = buf.get_f32_le()?;
13370 __struct.yaw_max = buf.get_f32_le()?;
13371 __struct.gimbal_device_id = buf.get_u8()?;
13372 Ok(__struct)
13373 }
13374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13375 let mut __tmp = BytesMut::new(bytes);
13376 #[allow(clippy::absurd_extreme_comparisons)]
13377 #[allow(unused_comparisons)]
13378 if __tmp.remaining() < Self::ENCODED_LEN {
13379 panic!(
13380 "buffer is too small (need {} bytes, but got {})",
13381 Self::ENCODED_LEN,
13382 __tmp.remaining(),
13383 )
13384 }
13385 __tmp.put_u32_le(self.time_boot_ms);
13386 __tmp.put_u32_le(self.cap_flags.bits() as u32);
13387 __tmp.put_f32_le(self.roll_min);
13388 __tmp.put_f32_le(self.roll_max);
13389 __tmp.put_f32_le(self.pitch_min);
13390 __tmp.put_f32_le(self.pitch_max);
13391 __tmp.put_f32_le(self.yaw_min);
13392 __tmp.put_f32_le(self.yaw_max);
13393 __tmp.put_u8(self.gimbal_device_id);
13394 if matches!(version, MavlinkVersion::V2) {
13395 let len = __tmp.len();
13396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13397 } else {
13398 __tmp.len()
13399 }
13400 }
13401}
13402#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13403#[doc = ""]
13404#[doc = "ID: 282"]
13405#[derive(Debug, Clone, PartialEq)]
13406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13408#[cfg_attr(feature = "ts", derive(TS))]
13409#[cfg_attr(feature = "ts", ts(export))]
13410pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13411 #[doc = "High level gimbal manager flags to use."]
13412 pub flags: GimbalManagerFlags,
13413 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13415 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13416 pub q: [f32; 4],
13417 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13418 pub angular_velocity_x: f32,
13419 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13420 pub angular_velocity_y: f32,
13421 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13422 pub angular_velocity_z: f32,
13423 #[doc = "System ID"]
13424 pub target_system: u8,
13425 #[doc = "Component ID"]
13426 pub target_component: u8,
13427 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13428 pub gimbal_device_id: u8,
13429}
13430impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13431 pub const ENCODED_LEN: usize = 35usize;
13432 pub const DEFAULT: Self = Self {
13433 flags: GimbalManagerFlags::DEFAULT,
13434 q: [0.0_f32; 4usize],
13435 angular_velocity_x: 0.0_f32,
13436 angular_velocity_y: 0.0_f32,
13437 angular_velocity_z: 0.0_f32,
13438 target_system: 0_u8,
13439 target_component: 0_u8,
13440 gimbal_device_id: 0_u8,
13441 };
13442 #[cfg(feature = "arbitrary")]
13443 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13444 use arbitrary::{Arbitrary, Unstructured};
13445 let mut buf = [0u8; 1024];
13446 rng.fill_bytes(&mut buf);
13447 let mut unstructured = Unstructured::new(&buf);
13448 Self::arbitrary(&mut unstructured).unwrap_or_default()
13449 }
13450}
13451impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13452 fn default() -> Self {
13453 Self::DEFAULT.clone()
13454 }
13455}
13456impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13457 type Message = MavMessage;
13458 const ID: u32 = 282u32;
13459 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13460 const EXTRA_CRC: u8 = 123u8;
13461 const ENCODED_LEN: usize = 35usize;
13462 fn deser(
13463 _version: MavlinkVersion,
13464 __input: &[u8],
13465 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13466 let avail_len = __input.len();
13467 let mut payload_buf = [0; Self::ENCODED_LEN];
13468 let mut buf = if avail_len < Self::ENCODED_LEN {
13469 payload_buf[0..avail_len].copy_from_slice(__input);
13470 Bytes::new(&payload_buf)
13471 } else {
13472 Bytes::new(__input)
13473 };
13474 let mut __struct = Self::default();
13475 let tmp = buf.get_u32_le()?;
13476 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13477 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13478 flag_type: "GimbalManagerFlags",
13479 value: tmp as u64,
13480 })?;
13481 for v in &mut __struct.q {
13482 let val = buf.get_f32_le()?;
13483 *v = val;
13484 }
13485 __struct.angular_velocity_x = buf.get_f32_le()?;
13486 __struct.angular_velocity_y = buf.get_f32_le()?;
13487 __struct.angular_velocity_z = buf.get_f32_le()?;
13488 __struct.target_system = buf.get_u8()?;
13489 __struct.target_component = buf.get_u8()?;
13490 __struct.gimbal_device_id = buf.get_u8()?;
13491 Ok(__struct)
13492 }
13493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13494 let mut __tmp = BytesMut::new(bytes);
13495 #[allow(clippy::absurd_extreme_comparisons)]
13496 #[allow(unused_comparisons)]
13497 if __tmp.remaining() < Self::ENCODED_LEN {
13498 panic!(
13499 "buffer is too small (need {} bytes, but got {})",
13500 Self::ENCODED_LEN,
13501 __tmp.remaining(),
13502 )
13503 }
13504 __tmp.put_u32_le(self.flags.bits() as u32);
13505 for val in &self.q {
13506 __tmp.put_f32_le(*val);
13507 }
13508 __tmp.put_f32_le(self.angular_velocity_x);
13509 __tmp.put_f32_le(self.angular_velocity_y);
13510 __tmp.put_f32_le(self.angular_velocity_z);
13511 __tmp.put_u8(self.target_system);
13512 __tmp.put_u8(self.target_component);
13513 __tmp.put_u8(self.gimbal_device_id);
13514 if matches!(version, MavlinkVersion::V2) {
13515 let len = __tmp.len();
13516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13517 } else {
13518 __tmp.len()
13519 }
13520 }
13521}
13522#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13523#[doc = ""]
13524#[doc = "ID: 288"]
13525#[derive(Debug, Clone, PartialEq)]
13526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13528#[cfg_attr(feature = "ts", derive(TS))]
13529#[cfg_attr(feature = "ts", ts(export))]
13530pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13531 #[doc = "High level gimbal manager flags."]
13532 pub flags: GimbalManagerFlags,
13533 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13534 pub pitch: f32,
13535 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13536 pub yaw: f32,
13537 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13538 pub pitch_rate: f32,
13539 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13540 pub yaw_rate: f32,
13541 #[doc = "System ID"]
13542 pub target_system: u8,
13543 #[doc = "Component ID"]
13544 pub target_component: u8,
13545 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13546 pub gimbal_device_id: u8,
13547}
13548impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13549 pub const ENCODED_LEN: usize = 23usize;
13550 pub const DEFAULT: Self = Self {
13551 flags: GimbalManagerFlags::DEFAULT,
13552 pitch: 0.0_f32,
13553 yaw: 0.0_f32,
13554 pitch_rate: 0.0_f32,
13555 yaw_rate: 0.0_f32,
13556 target_system: 0_u8,
13557 target_component: 0_u8,
13558 gimbal_device_id: 0_u8,
13559 };
13560 #[cfg(feature = "arbitrary")]
13561 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13562 use arbitrary::{Arbitrary, Unstructured};
13563 let mut buf = [0u8; 1024];
13564 rng.fill_bytes(&mut buf);
13565 let mut unstructured = Unstructured::new(&buf);
13566 Self::arbitrary(&mut unstructured).unwrap_or_default()
13567 }
13568}
13569impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13570 fn default() -> Self {
13571 Self::DEFAULT.clone()
13572 }
13573}
13574impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13575 type Message = MavMessage;
13576 const ID: u32 = 288u32;
13577 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13578 const EXTRA_CRC: u8 = 20u8;
13579 const ENCODED_LEN: usize = 23usize;
13580 fn deser(
13581 _version: MavlinkVersion,
13582 __input: &[u8],
13583 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13584 let avail_len = __input.len();
13585 let mut payload_buf = [0; Self::ENCODED_LEN];
13586 let mut buf = if avail_len < Self::ENCODED_LEN {
13587 payload_buf[0..avail_len].copy_from_slice(__input);
13588 Bytes::new(&payload_buf)
13589 } else {
13590 Bytes::new(__input)
13591 };
13592 let mut __struct = Self::default();
13593 let tmp = buf.get_u32_le()?;
13594 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13595 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13596 flag_type: "GimbalManagerFlags",
13597 value: tmp as u64,
13598 })?;
13599 __struct.pitch = buf.get_f32_le()?;
13600 __struct.yaw = buf.get_f32_le()?;
13601 __struct.pitch_rate = buf.get_f32_le()?;
13602 __struct.yaw_rate = buf.get_f32_le()?;
13603 __struct.target_system = buf.get_u8()?;
13604 __struct.target_component = buf.get_u8()?;
13605 __struct.gimbal_device_id = buf.get_u8()?;
13606 Ok(__struct)
13607 }
13608 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13609 let mut __tmp = BytesMut::new(bytes);
13610 #[allow(clippy::absurd_extreme_comparisons)]
13611 #[allow(unused_comparisons)]
13612 if __tmp.remaining() < Self::ENCODED_LEN {
13613 panic!(
13614 "buffer is too small (need {} bytes, but got {})",
13615 Self::ENCODED_LEN,
13616 __tmp.remaining(),
13617 )
13618 }
13619 __tmp.put_u32_le(self.flags.bits() as u32);
13620 __tmp.put_f32_le(self.pitch);
13621 __tmp.put_f32_le(self.yaw);
13622 __tmp.put_f32_le(self.pitch_rate);
13623 __tmp.put_f32_le(self.yaw_rate);
13624 __tmp.put_u8(self.target_system);
13625 __tmp.put_u8(self.target_component);
13626 __tmp.put_u8(self.gimbal_device_id);
13627 if matches!(version, MavlinkVersion::V2) {
13628 let len = __tmp.len();
13629 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13630 } else {
13631 __tmp.len()
13632 }
13633 }
13634}
13635#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13636#[doc = ""]
13637#[doc = "ID: 287"]
13638#[derive(Debug, Clone, PartialEq)]
13639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13641#[cfg_attr(feature = "ts", derive(TS))]
13642#[cfg_attr(feature = "ts", ts(export))]
13643pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13644 #[doc = "High level gimbal manager flags to use."]
13645 pub flags: GimbalManagerFlags,
13646 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13647 pub pitch: f32,
13648 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13649 pub yaw: f32,
13650 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13651 pub pitch_rate: f32,
13652 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13653 pub yaw_rate: f32,
13654 #[doc = "System ID"]
13655 pub target_system: u8,
13656 #[doc = "Component ID"]
13657 pub target_component: u8,
13658 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13659 pub gimbal_device_id: u8,
13660}
13661impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13662 pub const ENCODED_LEN: usize = 23usize;
13663 pub const DEFAULT: Self = Self {
13664 flags: GimbalManagerFlags::DEFAULT,
13665 pitch: 0.0_f32,
13666 yaw: 0.0_f32,
13667 pitch_rate: 0.0_f32,
13668 yaw_rate: 0.0_f32,
13669 target_system: 0_u8,
13670 target_component: 0_u8,
13671 gimbal_device_id: 0_u8,
13672 };
13673 #[cfg(feature = "arbitrary")]
13674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13675 use arbitrary::{Arbitrary, Unstructured};
13676 let mut buf = [0u8; 1024];
13677 rng.fill_bytes(&mut buf);
13678 let mut unstructured = Unstructured::new(&buf);
13679 Self::arbitrary(&mut unstructured).unwrap_or_default()
13680 }
13681}
13682impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13683 fn default() -> Self {
13684 Self::DEFAULT.clone()
13685 }
13686}
13687impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13688 type Message = MavMessage;
13689 const ID: u32 = 287u32;
13690 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13691 const EXTRA_CRC: u8 = 1u8;
13692 const ENCODED_LEN: usize = 23usize;
13693 fn deser(
13694 _version: MavlinkVersion,
13695 __input: &[u8],
13696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13697 let avail_len = __input.len();
13698 let mut payload_buf = [0; Self::ENCODED_LEN];
13699 let mut buf = if avail_len < Self::ENCODED_LEN {
13700 payload_buf[0..avail_len].copy_from_slice(__input);
13701 Bytes::new(&payload_buf)
13702 } else {
13703 Bytes::new(__input)
13704 };
13705 let mut __struct = Self::default();
13706 let tmp = buf.get_u32_le()?;
13707 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13708 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13709 flag_type: "GimbalManagerFlags",
13710 value: tmp as u64,
13711 })?;
13712 __struct.pitch = buf.get_f32_le()?;
13713 __struct.yaw = buf.get_f32_le()?;
13714 __struct.pitch_rate = buf.get_f32_le()?;
13715 __struct.yaw_rate = buf.get_f32_le()?;
13716 __struct.target_system = buf.get_u8()?;
13717 __struct.target_component = buf.get_u8()?;
13718 __struct.gimbal_device_id = buf.get_u8()?;
13719 Ok(__struct)
13720 }
13721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13722 let mut __tmp = BytesMut::new(bytes);
13723 #[allow(clippy::absurd_extreme_comparisons)]
13724 #[allow(unused_comparisons)]
13725 if __tmp.remaining() < Self::ENCODED_LEN {
13726 panic!(
13727 "buffer is too small (need {} bytes, but got {})",
13728 Self::ENCODED_LEN,
13729 __tmp.remaining(),
13730 )
13731 }
13732 __tmp.put_u32_le(self.flags.bits() as u32);
13733 __tmp.put_f32_le(self.pitch);
13734 __tmp.put_f32_le(self.yaw);
13735 __tmp.put_f32_le(self.pitch_rate);
13736 __tmp.put_f32_le(self.yaw_rate);
13737 __tmp.put_u8(self.target_system);
13738 __tmp.put_u8(self.target_component);
13739 __tmp.put_u8(self.gimbal_device_id);
13740 if matches!(version, MavlinkVersion::V2) {
13741 let len = __tmp.len();
13742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13743 } else {
13744 __tmp.len()
13745 }
13746 }
13747}
13748#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13749#[doc = ""]
13750#[doc = "ID: 281"]
13751#[derive(Debug, Clone, PartialEq)]
13752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13754#[cfg_attr(feature = "ts", derive(TS))]
13755#[cfg_attr(feature = "ts", ts(export))]
13756pub struct GIMBAL_MANAGER_STATUS_DATA {
13757 #[doc = "Timestamp (time since system boot)."]
13758 pub time_boot_ms: u32,
13759 #[doc = "High level gimbal manager flags currently applied."]
13760 pub flags: GimbalManagerFlags,
13761 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13762 pub gimbal_device_id: u8,
13763 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13764 pub primary_control_sysid: u8,
13765 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13766 pub primary_control_compid: u8,
13767 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13768 pub secondary_control_sysid: u8,
13769 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13770 pub secondary_control_compid: u8,
13771}
13772impl GIMBAL_MANAGER_STATUS_DATA {
13773 pub const ENCODED_LEN: usize = 13usize;
13774 pub const DEFAULT: Self = Self {
13775 time_boot_ms: 0_u32,
13776 flags: GimbalManagerFlags::DEFAULT,
13777 gimbal_device_id: 0_u8,
13778 primary_control_sysid: 0_u8,
13779 primary_control_compid: 0_u8,
13780 secondary_control_sysid: 0_u8,
13781 secondary_control_compid: 0_u8,
13782 };
13783 #[cfg(feature = "arbitrary")]
13784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13785 use arbitrary::{Arbitrary, Unstructured};
13786 let mut buf = [0u8; 1024];
13787 rng.fill_bytes(&mut buf);
13788 let mut unstructured = Unstructured::new(&buf);
13789 Self::arbitrary(&mut unstructured).unwrap_or_default()
13790 }
13791}
13792impl Default for GIMBAL_MANAGER_STATUS_DATA {
13793 fn default() -> Self {
13794 Self::DEFAULT.clone()
13795 }
13796}
13797impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13798 type Message = MavMessage;
13799 const ID: u32 = 281u32;
13800 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13801 const EXTRA_CRC: u8 = 48u8;
13802 const ENCODED_LEN: usize = 13usize;
13803 fn deser(
13804 _version: MavlinkVersion,
13805 __input: &[u8],
13806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13807 let avail_len = __input.len();
13808 let mut payload_buf = [0; Self::ENCODED_LEN];
13809 let mut buf = if avail_len < Self::ENCODED_LEN {
13810 payload_buf[0..avail_len].copy_from_slice(__input);
13811 Bytes::new(&payload_buf)
13812 } else {
13813 Bytes::new(__input)
13814 };
13815 let mut __struct = Self::default();
13816 __struct.time_boot_ms = buf.get_u32_le()?;
13817 let tmp = buf.get_u32_le()?;
13818 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13819 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13820 flag_type: "GimbalManagerFlags",
13821 value: tmp as u64,
13822 })?;
13823 __struct.gimbal_device_id = buf.get_u8()?;
13824 __struct.primary_control_sysid = buf.get_u8()?;
13825 __struct.primary_control_compid = buf.get_u8()?;
13826 __struct.secondary_control_sysid = buf.get_u8()?;
13827 __struct.secondary_control_compid = buf.get_u8()?;
13828 Ok(__struct)
13829 }
13830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13831 let mut __tmp = BytesMut::new(bytes);
13832 #[allow(clippy::absurd_extreme_comparisons)]
13833 #[allow(unused_comparisons)]
13834 if __tmp.remaining() < Self::ENCODED_LEN {
13835 panic!(
13836 "buffer is too small (need {} bytes, but got {})",
13837 Self::ENCODED_LEN,
13838 __tmp.remaining(),
13839 )
13840 }
13841 __tmp.put_u32_le(self.time_boot_ms);
13842 __tmp.put_u32_le(self.flags.bits() as u32);
13843 __tmp.put_u8(self.gimbal_device_id);
13844 __tmp.put_u8(self.primary_control_sysid);
13845 __tmp.put_u8(self.primary_control_compid);
13846 __tmp.put_u8(self.secondary_control_sysid);
13847 __tmp.put_u8(self.secondary_control_compid);
13848 if matches!(version, MavlinkVersion::V2) {
13849 let len = __tmp.len();
13850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13851 } else {
13852 __tmp.len()
13853 }
13854 }
13855}
13856#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13857#[doc = ""]
13858#[doc = "ID: 33"]
13859#[derive(Debug, Clone, PartialEq)]
13860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13862#[cfg_attr(feature = "ts", derive(TS))]
13863#[cfg_attr(feature = "ts", ts(export))]
13864pub struct GLOBAL_POSITION_INT_DATA {
13865 #[doc = "Timestamp (time since system boot)."]
13866 pub time_boot_ms: u32,
13867 #[doc = "Latitude, expressed"]
13868 pub lat: i32,
13869 #[doc = "Longitude, expressed"]
13870 pub lon: i32,
13871 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13872 pub alt: i32,
13873 #[doc = "Altitude above home"]
13874 pub relative_alt: i32,
13875 #[doc = "Ground X Speed (Latitude, positive north)"]
13876 pub vx: i16,
13877 #[doc = "Ground Y Speed (Longitude, positive east)"]
13878 pub vy: i16,
13879 #[doc = "Ground Z Speed (Altitude, positive down)"]
13880 pub vz: i16,
13881 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13882 pub hdg: u16,
13883}
13884impl GLOBAL_POSITION_INT_DATA {
13885 pub const ENCODED_LEN: usize = 28usize;
13886 pub const DEFAULT: Self = Self {
13887 time_boot_ms: 0_u32,
13888 lat: 0_i32,
13889 lon: 0_i32,
13890 alt: 0_i32,
13891 relative_alt: 0_i32,
13892 vx: 0_i16,
13893 vy: 0_i16,
13894 vz: 0_i16,
13895 hdg: 0_u16,
13896 };
13897 #[cfg(feature = "arbitrary")]
13898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13899 use arbitrary::{Arbitrary, Unstructured};
13900 let mut buf = [0u8; 1024];
13901 rng.fill_bytes(&mut buf);
13902 let mut unstructured = Unstructured::new(&buf);
13903 Self::arbitrary(&mut unstructured).unwrap_or_default()
13904 }
13905}
13906impl Default for GLOBAL_POSITION_INT_DATA {
13907 fn default() -> Self {
13908 Self::DEFAULT.clone()
13909 }
13910}
13911impl MessageData for GLOBAL_POSITION_INT_DATA {
13912 type Message = MavMessage;
13913 const ID: u32 = 33u32;
13914 const NAME: &'static str = "GLOBAL_POSITION_INT";
13915 const EXTRA_CRC: u8 = 104u8;
13916 const ENCODED_LEN: usize = 28usize;
13917 fn deser(
13918 _version: MavlinkVersion,
13919 __input: &[u8],
13920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13921 let avail_len = __input.len();
13922 let mut payload_buf = [0; Self::ENCODED_LEN];
13923 let mut buf = if avail_len < Self::ENCODED_LEN {
13924 payload_buf[0..avail_len].copy_from_slice(__input);
13925 Bytes::new(&payload_buf)
13926 } else {
13927 Bytes::new(__input)
13928 };
13929 let mut __struct = Self::default();
13930 __struct.time_boot_ms = buf.get_u32_le()?;
13931 __struct.lat = buf.get_i32_le()?;
13932 __struct.lon = buf.get_i32_le()?;
13933 __struct.alt = buf.get_i32_le()?;
13934 __struct.relative_alt = buf.get_i32_le()?;
13935 __struct.vx = buf.get_i16_le()?;
13936 __struct.vy = buf.get_i16_le()?;
13937 __struct.vz = buf.get_i16_le()?;
13938 __struct.hdg = buf.get_u16_le()?;
13939 Ok(__struct)
13940 }
13941 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13942 let mut __tmp = BytesMut::new(bytes);
13943 #[allow(clippy::absurd_extreme_comparisons)]
13944 #[allow(unused_comparisons)]
13945 if __tmp.remaining() < Self::ENCODED_LEN {
13946 panic!(
13947 "buffer is too small (need {} bytes, but got {})",
13948 Self::ENCODED_LEN,
13949 __tmp.remaining(),
13950 )
13951 }
13952 __tmp.put_u32_le(self.time_boot_ms);
13953 __tmp.put_i32_le(self.lat);
13954 __tmp.put_i32_le(self.lon);
13955 __tmp.put_i32_le(self.alt);
13956 __tmp.put_i32_le(self.relative_alt);
13957 __tmp.put_i16_le(self.vx);
13958 __tmp.put_i16_le(self.vy);
13959 __tmp.put_i16_le(self.vz);
13960 __tmp.put_u16_le(self.hdg);
13961 if matches!(version, MavlinkVersion::V2) {
13962 let len = __tmp.len();
13963 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13964 } else {
13965 __tmp.len()
13966 }
13967 }
13968}
13969#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13970#[doc = ""]
13971#[doc = "ID: 63"]
13972#[derive(Debug, Clone, PartialEq)]
13973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13974#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13975#[cfg_attr(feature = "ts", derive(TS))]
13976#[cfg_attr(feature = "ts", ts(export))]
13977pub struct GLOBAL_POSITION_INT_COV_DATA {
13978 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13979 pub time_usec: u64,
13980 #[doc = "Latitude"]
13981 pub lat: i32,
13982 #[doc = "Longitude"]
13983 pub lon: i32,
13984 #[doc = "Altitude in meters above MSL"]
13985 pub alt: i32,
13986 #[doc = "Altitude above ground"]
13987 pub relative_alt: i32,
13988 #[doc = "Ground X Speed (Latitude)"]
13989 pub vx: f32,
13990 #[doc = "Ground Y Speed (Longitude)"]
13991 pub vy: f32,
13992 #[doc = "Ground Z Speed (Altitude)"]
13993 pub vz: f32,
13994 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13995 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13996 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13997 pub covariance: [f32; 36],
13998 #[doc = "Class id of the estimator this estimate originated from."]
13999 pub estimator_type: MavEstimatorType,
14000}
14001impl GLOBAL_POSITION_INT_COV_DATA {
14002 pub const ENCODED_LEN: usize = 181usize;
14003 pub const DEFAULT: Self = Self {
14004 time_usec: 0_u64,
14005 lat: 0_i32,
14006 lon: 0_i32,
14007 alt: 0_i32,
14008 relative_alt: 0_i32,
14009 vx: 0.0_f32,
14010 vy: 0.0_f32,
14011 vz: 0.0_f32,
14012 covariance: [0.0_f32; 36usize],
14013 estimator_type: MavEstimatorType::DEFAULT,
14014 };
14015 #[cfg(feature = "arbitrary")]
14016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14017 use arbitrary::{Arbitrary, Unstructured};
14018 let mut buf = [0u8; 1024];
14019 rng.fill_bytes(&mut buf);
14020 let mut unstructured = Unstructured::new(&buf);
14021 Self::arbitrary(&mut unstructured).unwrap_or_default()
14022 }
14023}
14024impl Default for GLOBAL_POSITION_INT_COV_DATA {
14025 fn default() -> Self {
14026 Self::DEFAULT.clone()
14027 }
14028}
14029impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14030 type Message = MavMessage;
14031 const ID: u32 = 63u32;
14032 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14033 const EXTRA_CRC: u8 = 119u8;
14034 const ENCODED_LEN: usize = 181usize;
14035 fn deser(
14036 _version: MavlinkVersion,
14037 __input: &[u8],
14038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14039 let avail_len = __input.len();
14040 let mut payload_buf = [0; Self::ENCODED_LEN];
14041 let mut buf = if avail_len < Self::ENCODED_LEN {
14042 payload_buf[0..avail_len].copy_from_slice(__input);
14043 Bytes::new(&payload_buf)
14044 } else {
14045 Bytes::new(__input)
14046 };
14047 let mut __struct = Self::default();
14048 __struct.time_usec = buf.get_u64_le()?;
14049 __struct.lat = buf.get_i32_le()?;
14050 __struct.lon = buf.get_i32_le()?;
14051 __struct.alt = buf.get_i32_le()?;
14052 __struct.relative_alt = buf.get_i32_le()?;
14053 __struct.vx = buf.get_f32_le()?;
14054 __struct.vy = buf.get_f32_le()?;
14055 __struct.vz = buf.get_f32_le()?;
14056 for v in &mut __struct.covariance {
14057 let val = buf.get_f32_le()?;
14058 *v = val;
14059 }
14060 let tmp = buf.get_u8()?;
14061 __struct.estimator_type =
14062 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14063 enum_type: "MavEstimatorType",
14064 value: tmp as u64,
14065 })?;
14066 Ok(__struct)
14067 }
14068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14069 let mut __tmp = BytesMut::new(bytes);
14070 #[allow(clippy::absurd_extreme_comparisons)]
14071 #[allow(unused_comparisons)]
14072 if __tmp.remaining() < Self::ENCODED_LEN {
14073 panic!(
14074 "buffer is too small (need {} bytes, but got {})",
14075 Self::ENCODED_LEN,
14076 __tmp.remaining(),
14077 )
14078 }
14079 __tmp.put_u64_le(self.time_usec);
14080 __tmp.put_i32_le(self.lat);
14081 __tmp.put_i32_le(self.lon);
14082 __tmp.put_i32_le(self.alt);
14083 __tmp.put_i32_le(self.relative_alt);
14084 __tmp.put_f32_le(self.vx);
14085 __tmp.put_f32_le(self.vy);
14086 __tmp.put_f32_le(self.vz);
14087 for val in &self.covariance {
14088 __tmp.put_f32_le(*val);
14089 }
14090 __tmp.put_u8(self.estimator_type as u8);
14091 if matches!(version, MavlinkVersion::V2) {
14092 let len = __tmp.len();
14093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14094 } else {
14095 __tmp.len()
14096 }
14097 }
14098}
14099#[doc = "Global position/attitude estimate from a vision source."]
14100#[doc = ""]
14101#[doc = "ID: 101"]
14102#[derive(Debug, Clone, PartialEq)]
14103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14105#[cfg_attr(feature = "ts", derive(TS))]
14106#[cfg_attr(feature = "ts", ts(export))]
14107pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14108 #[doc = "Timestamp (UNIX time or since system boot)"]
14109 pub usec: u64,
14110 #[doc = "Global X position"]
14111 pub x: f32,
14112 #[doc = "Global Y position"]
14113 pub y: f32,
14114 #[doc = "Global Z position"]
14115 pub z: f32,
14116 #[doc = "Roll angle"]
14117 pub roll: f32,
14118 #[doc = "Pitch angle"]
14119 pub pitch: f32,
14120 #[doc = "Yaw angle"]
14121 pub yaw: f32,
14122 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14123 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14124 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14125 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14126 pub covariance: [f32; 21],
14127 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14129 pub reset_counter: u8,
14130}
14131impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14132 pub const ENCODED_LEN: usize = 117usize;
14133 pub const DEFAULT: Self = Self {
14134 usec: 0_u64,
14135 x: 0.0_f32,
14136 y: 0.0_f32,
14137 z: 0.0_f32,
14138 roll: 0.0_f32,
14139 pitch: 0.0_f32,
14140 yaw: 0.0_f32,
14141 covariance: [0.0_f32; 21usize],
14142 reset_counter: 0_u8,
14143 };
14144 #[cfg(feature = "arbitrary")]
14145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14146 use arbitrary::{Arbitrary, Unstructured};
14147 let mut buf = [0u8; 1024];
14148 rng.fill_bytes(&mut buf);
14149 let mut unstructured = Unstructured::new(&buf);
14150 Self::arbitrary(&mut unstructured).unwrap_or_default()
14151 }
14152}
14153impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14154 fn default() -> Self {
14155 Self::DEFAULT.clone()
14156 }
14157}
14158impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14159 type Message = MavMessage;
14160 const ID: u32 = 101u32;
14161 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14162 const EXTRA_CRC: u8 = 102u8;
14163 const ENCODED_LEN: usize = 117usize;
14164 fn deser(
14165 _version: MavlinkVersion,
14166 __input: &[u8],
14167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14168 let avail_len = __input.len();
14169 let mut payload_buf = [0; Self::ENCODED_LEN];
14170 let mut buf = if avail_len < Self::ENCODED_LEN {
14171 payload_buf[0..avail_len].copy_from_slice(__input);
14172 Bytes::new(&payload_buf)
14173 } else {
14174 Bytes::new(__input)
14175 };
14176 let mut __struct = Self::default();
14177 __struct.usec = buf.get_u64_le()?;
14178 __struct.x = buf.get_f32_le()?;
14179 __struct.y = buf.get_f32_le()?;
14180 __struct.z = buf.get_f32_le()?;
14181 __struct.roll = buf.get_f32_le()?;
14182 __struct.pitch = buf.get_f32_le()?;
14183 __struct.yaw = buf.get_f32_le()?;
14184 for v in &mut __struct.covariance {
14185 let val = buf.get_f32_le()?;
14186 *v = val;
14187 }
14188 __struct.reset_counter = buf.get_u8()?;
14189 Ok(__struct)
14190 }
14191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14192 let mut __tmp = BytesMut::new(bytes);
14193 #[allow(clippy::absurd_extreme_comparisons)]
14194 #[allow(unused_comparisons)]
14195 if __tmp.remaining() < Self::ENCODED_LEN {
14196 panic!(
14197 "buffer is too small (need {} bytes, but got {})",
14198 Self::ENCODED_LEN,
14199 __tmp.remaining(),
14200 )
14201 }
14202 __tmp.put_u64_le(self.usec);
14203 __tmp.put_f32_le(self.x);
14204 __tmp.put_f32_le(self.y);
14205 __tmp.put_f32_le(self.z);
14206 __tmp.put_f32_le(self.roll);
14207 __tmp.put_f32_le(self.pitch);
14208 __tmp.put_f32_le(self.yaw);
14209 if matches!(version, MavlinkVersion::V2) {
14210 for val in &self.covariance {
14211 __tmp.put_f32_le(*val);
14212 }
14213 __tmp.put_u8(self.reset_counter);
14214 let len = __tmp.len();
14215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14216 } else {
14217 __tmp.len()
14218 }
14219 }
14220}
14221#[doc = "Information about key components of GNSS receivers, like signal authentication, interference and system errors."]
14222#[doc = ""]
14223#[doc = "ID: 441"]
14224#[derive(Debug, Clone, PartialEq)]
14225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14226#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14227#[cfg_attr(feature = "ts", derive(TS))]
14228#[cfg_attr(feature = "ts", ts(export))]
14229pub struct GNSS_INTEGRITY_DATA {
14230 #[doc = "Errors in the GPS system."]
14231 pub system_errors: GpsSystemErrorFlags,
14232 #[doc = "Horizontal expected accuracy using satellites successfully validated using RAIM."]
14233 pub raim_hfom: u16,
14234 #[doc = "Vertical expected accuracy using satellites successfully validated using RAIM."]
14235 pub raim_vfom: u16,
14236 #[doc = "GNSS receiver id. Must match instance ids of other messages from same receiver."]
14237 pub id: u8,
14238 #[doc = "Signal authentication state of the GPS system."]
14239 pub authentication_state: GpsAuthenticationState,
14240 #[doc = "Signal jamming state of the GPS system."]
14241 pub jamming_state: GpsJammingState,
14242 #[doc = "Signal spoofing state of the GPS system."]
14243 pub spoofing_state: GpsSpoofingState,
14244 #[doc = "The state of the RAIM processing."]
14245 pub raim_state: GpsRaimState,
14246 #[doc = "An abstract value representing the estimated quality of incoming corrections, or 255 if not available."]
14247 pub corrections_quality: u8,
14248 #[doc = "An abstract value representing the overall status of the receiver, or 255 if not available."]
14249 pub system_status_summary: u8,
14250 #[doc = "An abstract value representing the quality of incoming GNSS signals, or 255 if not available."]
14251 pub gnss_signal_quality: u8,
14252 #[doc = "An abstract value representing the estimated PPK quality, or 255 if not available."]
14253 pub post_processing_quality: u8,
14254}
14255impl GNSS_INTEGRITY_DATA {
14256 pub const ENCODED_LEN: usize = 17usize;
14257 pub const DEFAULT: Self = Self {
14258 system_errors: GpsSystemErrorFlags::DEFAULT,
14259 raim_hfom: 0_u16,
14260 raim_vfom: 0_u16,
14261 id: 0_u8,
14262 authentication_state: GpsAuthenticationState::DEFAULT,
14263 jamming_state: GpsJammingState::DEFAULT,
14264 spoofing_state: GpsSpoofingState::DEFAULT,
14265 raim_state: GpsRaimState::DEFAULT,
14266 corrections_quality: 0_u8,
14267 system_status_summary: 0_u8,
14268 gnss_signal_quality: 0_u8,
14269 post_processing_quality: 0_u8,
14270 };
14271 #[cfg(feature = "arbitrary")]
14272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14273 use arbitrary::{Arbitrary, Unstructured};
14274 let mut buf = [0u8; 1024];
14275 rng.fill_bytes(&mut buf);
14276 let mut unstructured = Unstructured::new(&buf);
14277 Self::arbitrary(&mut unstructured).unwrap_or_default()
14278 }
14279}
14280impl Default for GNSS_INTEGRITY_DATA {
14281 fn default() -> Self {
14282 Self::DEFAULT.clone()
14283 }
14284}
14285impl MessageData for GNSS_INTEGRITY_DATA {
14286 type Message = MavMessage;
14287 const ID: u32 = 441u32;
14288 const NAME: &'static str = "GNSS_INTEGRITY";
14289 const EXTRA_CRC: u8 = 169u8;
14290 const ENCODED_LEN: usize = 17usize;
14291 fn deser(
14292 _version: MavlinkVersion,
14293 __input: &[u8],
14294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14295 let avail_len = __input.len();
14296 let mut payload_buf = [0; Self::ENCODED_LEN];
14297 let mut buf = if avail_len < Self::ENCODED_LEN {
14298 payload_buf[0..avail_len].copy_from_slice(__input);
14299 Bytes::new(&payload_buf)
14300 } else {
14301 Bytes::new(__input)
14302 };
14303 let mut __struct = Self::default();
14304 let tmp = buf.get_u32_le()?;
14305 __struct.system_errors = GpsSystemErrorFlags::from_bits(
14306 tmp as <GpsSystemErrorFlags as Flags>::Bits,
14307 )
14308 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14309 flag_type: "GpsSystemErrorFlags",
14310 value: tmp as u64,
14311 })?;
14312 __struct.raim_hfom = buf.get_u16_le()?;
14313 __struct.raim_vfom = buf.get_u16_le()?;
14314 __struct.id = buf.get_u8()?;
14315 let tmp = buf.get_u8()?;
14316 __struct.authentication_state =
14317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14318 enum_type: "GpsAuthenticationState",
14319 value: tmp as u64,
14320 })?;
14321 let tmp = buf.get_u8()?;
14322 __struct.jamming_state =
14323 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14324 enum_type: "GpsJammingState",
14325 value: tmp as u64,
14326 })?;
14327 let tmp = buf.get_u8()?;
14328 __struct.spoofing_state =
14329 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14330 enum_type: "GpsSpoofingState",
14331 value: tmp as u64,
14332 })?;
14333 let tmp = buf.get_u8()?;
14334 __struct.raim_state =
14335 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14336 enum_type: "GpsRaimState",
14337 value: tmp as u64,
14338 })?;
14339 __struct.corrections_quality = buf.get_u8()?;
14340 __struct.system_status_summary = buf.get_u8()?;
14341 __struct.gnss_signal_quality = buf.get_u8()?;
14342 __struct.post_processing_quality = buf.get_u8()?;
14343 Ok(__struct)
14344 }
14345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14346 let mut __tmp = BytesMut::new(bytes);
14347 #[allow(clippy::absurd_extreme_comparisons)]
14348 #[allow(unused_comparisons)]
14349 if __tmp.remaining() < Self::ENCODED_LEN {
14350 panic!(
14351 "buffer is too small (need {} bytes, but got {})",
14352 Self::ENCODED_LEN,
14353 __tmp.remaining(),
14354 )
14355 }
14356 __tmp.put_u32_le(self.system_errors.bits() as u32);
14357 __tmp.put_u16_le(self.raim_hfom);
14358 __tmp.put_u16_le(self.raim_vfom);
14359 __tmp.put_u8(self.id);
14360 __tmp.put_u8(self.authentication_state as u8);
14361 __tmp.put_u8(self.jamming_state as u8);
14362 __tmp.put_u8(self.spoofing_state as u8);
14363 __tmp.put_u8(self.raim_state as u8);
14364 __tmp.put_u8(self.corrections_quality);
14365 __tmp.put_u8(self.system_status_summary);
14366 __tmp.put_u8(self.gnss_signal_quality);
14367 __tmp.put_u8(self.post_processing_quality);
14368 if matches!(version, MavlinkVersion::V2) {
14369 let len = __tmp.len();
14370 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14371 } else {
14372 __tmp.len()
14373 }
14374 }
14375}
14376#[doc = "Second GPS data."]
14377#[doc = ""]
14378#[doc = "ID: 124"]
14379#[derive(Debug, Clone, PartialEq)]
14380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14382#[cfg_attr(feature = "ts", derive(TS))]
14383#[cfg_attr(feature = "ts", ts(export))]
14384pub struct GPS2_RAW_DATA {
14385 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14386 pub time_usec: u64,
14387 #[doc = "Latitude (WGS84)"]
14388 pub lat: i32,
14389 #[doc = "Longitude (WGS84)"]
14390 pub lon: i32,
14391 #[doc = "Altitude (MSL). Positive for up."]
14392 pub alt: i32,
14393 #[doc = "Age of DGPS info"]
14394 pub dgps_age: u32,
14395 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14396 pub eph: u16,
14397 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14398 pub epv: u16,
14399 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14400 pub vel: u16,
14401 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14402 pub cog: u16,
14403 #[doc = "GPS fix type."]
14404 pub fix_type: GpsFixType,
14405 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14406 pub satellites_visible: u8,
14407 #[doc = "Number of DGPS satellites"]
14408 pub dgps_numch: u8,
14409 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14411 pub yaw: u16,
14412 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14413 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14414 pub alt_ellipsoid: i32,
14415 #[doc = "Position uncertainty."]
14416 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14417 pub h_acc: u32,
14418 #[doc = "Altitude uncertainty."]
14419 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14420 pub v_acc: u32,
14421 #[doc = "Speed uncertainty."]
14422 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14423 pub vel_acc: u32,
14424 #[doc = "Heading / track uncertainty"]
14425 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14426 pub hdg_acc: u32,
14427}
14428impl GPS2_RAW_DATA {
14429 pub const ENCODED_LEN: usize = 57usize;
14430 pub const DEFAULT: Self = Self {
14431 time_usec: 0_u64,
14432 lat: 0_i32,
14433 lon: 0_i32,
14434 alt: 0_i32,
14435 dgps_age: 0_u32,
14436 eph: 0_u16,
14437 epv: 0_u16,
14438 vel: 0_u16,
14439 cog: 0_u16,
14440 fix_type: GpsFixType::DEFAULT,
14441 satellites_visible: 0_u8,
14442 dgps_numch: 0_u8,
14443 yaw: 0_u16,
14444 alt_ellipsoid: 0_i32,
14445 h_acc: 0_u32,
14446 v_acc: 0_u32,
14447 vel_acc: 0_u32,
14448 hdg_acc: 0_u32,
14449 };
14450 #[cfg(feature = "arbitrary")]
14451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14452 use arbitrary::{Arbitrary, Unstructured};
14453 let mut buf = [0u8; 1024];
14454 rng.fill_bytes(&mut buf);
14455 let mut unstructured = Unstructured::new(&buf);
14456 Self::arbitrary(&mut unstructured).unwrap_or_default()
14457 }
14458}
14459impl Default for GPS2_RAW_DATA {
14460 fn default() -> Self {
14461 Self::DEFAULT.clone()
14462 }
14463}
14464impl MessageData for GPS2_RAW_DATA {
14465 type Message = MavMessage;
14466 const ID: u32 = 124u32;
14467 const NAME: &'static str = "GPS2_RAW";
14468 const EXTRA_CRC: u8 = 87u8;
14469 const ENCODED_LEN: usize = 57usize;
14470 fn deser(
14471 _version: MavlinkVersion,
14472 __input: &[u8],
14473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14474 let avail_len = __input.len();
14475 let mut payload_buf = [0; Self::ENCODED_LEN];
14476 let mut buf = if avail_len < Self::ENCODED_LEN {
14477 payload_buf[0..avail_len].copy_from_slice(__input);
14478 Bytes::new(&payload_buf)
14479 } else {
14480 Bytes::new(__input)
14481 };
14482 let mut __struct = Self::default();
14483 __struct.time_usec = buf.get_u64_le()?;
14484 __struct.lat = buf.get_i32_le()?;
14485 __struct.lon = buf.get_i32_le()?;
14486 __struct.alt = buf.get_i32_le()?;
14487 __struct.dgps_age = buf.get_u32_le()?;
14488 __struct.eph = buf.get_u16_le()?;
14489 __struct.epv = buf.get_u16_le()?;
14490 __struct.vel = buf.get_u16_le()?;
14491 __struct.cog = buf.get_u16_le()?;
14492 let tmp = buf.get_u8()?;
14493 __struct.fix_type =
14494 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14495 enum_type: "GpsFixType",
14496 value: tmp as u64,
14497 })?;
14498 __struct.satellites_visible = buf.get_u8()?;
14499 __struct.dgps_numch = buf.get_u8()?;
14500 __struct.yaw = buf.get_u16_le()?;
14501 __struct.alt_ellipsoid = buf.get_i32_le()?;
14502 __struct.h_acc = buf.get_u32_le()?;
14503 __struct.v_acc = buf.get_u32_le()?;
14504 __struct.vel_acc = buf.get_u32_le()?;
14505 __struct.hdg_acc = buf.get_u32_le()?;
14506 Ok(__struct)
14507 }
14508 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14509 let mut __tmp = BytesMut::new(bytes);
14510 #[allow(clippy::absurd_extreme_comparisons)]
14511 #[allow(unused_comparisons)]
14512 if __tmp.remaining() < Self::ENCODED_LEN {
14513 panic!(
14514 "buffer is too small (need {} bytes, but got {})",
14515 Self::ENCODED_LEN,
14516 __tmp.remaining(),
14517 )
14518 }
14519 __tmp.put_u64_le(self.time_usec);
14520 __tmp.put_i32_le(self.lat);
14521 __tmp.put_i32_le(self.lon);
14522 __tmp.put_i32_le(self.alt);
14523 __tmp.put_u32_le(self.dgps_age);
14524 __tmp.put_u16_le(self.eph);
14525 __tmp.put_u16_le(self.epv);
14526 __tmp.put_u16_le(self.vel);
14527 __tmp.put_u16_le(self.cog);
14528 __tmp.put_u8(self.fix_type as u8);
14529 __tmp.put_u8(self.satellites_visible);
14530 __tmp.put_u8(self.dgps_numch);
14531 if matches!(version, MavlinkVersion::V2) {
14532 __tmp.put_u16_le(self.yaw);
14533 __tmp.put_i32_le(self.alt_ellipsoid);
14534 __tmp.put_u32_le(self.h_acc);
14535 __tmp.put_u32_le(self.v_acc);
14536 __tmp.put_u32_le(self.vel_acc);
14537 __tmp.put_u32_le(self.hdg_acc);
14538 let len = __tmp.len();
14539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14540 } else {
14541 __tmp.len()
14542 }
14543 }
14544}
14545#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14546#[doc = ""]
14547#[doc = "ID: 128"]
14548#[derive(Debug, Clone, PartialEq)]
14549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14551#[cfg_attr(feature = "ts", derive(TS))]
14552#[cfg_attr(feature = "ts", ts(export))]
14553pub struct GPS2_RTK_DATA {
14554 #[doc = "Time since boot of last baseline message received."]
14555 pub time_last_baseline_ms: u32,
14556 #[doc = "GPS Time of Week of last baseline"]
14557 pub tow: u32,
14558 #[doc = "Current baseline in ECEF x or NED north component."]
14559 pub baseline_a_mm: i32,
14560 #[doc = "Current baseline in ECEF y or NED east component."]
14561 pub baseline_b_mm: i32,
14562 #[doc = "Current baseline in ECEF z or NED down component."]
14563 pub baseline_c_mm: i32,
14564 #[doc = "Current estimate of baseline accuracy."]
14565 pub accuracy: u32,
14566 #[doc = "Current number of integer ambiguity hypotheses."]
14567 pub iar_num_hypotheses: i32,
14568 #[doc = "GPS Week Number of last baseline"]
14569 pub wn: u16,
14570 #[doc = "Identification of connected RTK receiver."]
14571 pub rtk_receiver_id: u8,
14572 #[doc = "GPS-specific health report for RTK data."]
14573 pub rtk_health: u8,
14574 #[doc = "Rate of baseline messages being received by GPS"]
14575 pub rtk_rate: u8,
14576 #[doc = "Current number of sats used for RTK calculation."]
14577 pub nsats: u8,
14578 #[doc = "Coordinate system of baseline"]
14579 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14580}
14581impl GPS2_RTK_DATA {
14582 pub const ENCODED_LEN: usize = 35usize;
14583 pub const DEFAULT: Self = Self {
14584 time_last_baseline_ms: 0_u32,
14585 tow: 0_u32,
14586 baseline_a_mm: 0_i32,
14587 baseline_b_mm: 0_i32,
14588 baseline_c_mm: 0_i32,
14589 accuracy: 0_u32,
14590 iar_num_hypotheses: 0_i32,
14591 wn: 0_u16,
14592 rtk_receiver_id: 0_u8,
14593 rtk_health: 0_u8,
14594 rtk_rate: 0_u8,
14595 nsats: 0_u8,
14596 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14597 };
14598 #[cfg(feature = "arbitrary")]
14599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14600 use arbitrary::{Arbitrary, Unstructured};
14601 let mut buf = [0u8; 1024];
14602 rng.fill_bytes(&mut buf);
14603 let mut unstructured = Unstructured::new(&buf);
14604 Self::arbitrary(&mut unstructured).unwrap_or_default()
14605 }
14606}
14607impl Default for GPS2_RTK_DATA {
14608 fn default() -> Self {
14609 Self::DEFAULT.clone()
14610 }
14611}
14612impl MessageData for GPS2_RTK_DATA {
14613 type Message = MavMessage;
14614 const ID: u32 = 128u32;
14615 const NAME: &'static str = "GPS2_RTK";
14616 const EXTRA_CRC: u8 = 226u8;
14617 const ENCODED_LEN: usize = 35usize;
14618 fn deser(
14619 _version: MavlinkVersion,
14620 __input: &[u8],
14621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14622 let avail_len = __input.len();
14623 let mut payload_buf = [0; Self::ENCODED_LEN];
14624 let mut buf = if avail_len < Self::ENCODED_LEN {
14625 payload_buf[0..avail_len].copy_from_slice(__input);
14626 Bytes::new(&payload_buf)
14627 } else {
14628 Bytes::new(__input)
14629 };
14630 let mut __struct = Self::default();
14631 __struct.time_last_baseline_ms = buf.get_u32_le()?;
14632 __struct.tow = buf.get_u32_le()?;
14633 __struct.baseline_a_mm = buf.get_i32_le()?;
14634 __struct.baseline_b_mm = buf.get_i32_le()?;
14635 __struct.baseline_c_mm = buf.get_i32_le()?;
14636 __struct.accuracy = buf.get_u32_le()?;
14637 __struct.iar_num_hypotheses = buf.get_i32_le()?;
14638 __struct.wn = buf.get_u16_le()?;
14639 __struct.rtk_receiver_id = buf.get_u8()?;
14640 __struct.rtk_health = buf.get_u8()?;
14641 __struct.rtk_rate = buf.get_u8()?;
14642 __struct.nsats = buf.get_u8()?;
14643 let tmp = buf.get_u8()?;
14644 __struct.baseline_coords_type =
14645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14646 enum_type: "RtkBaselineCoordinateSystem",
14647 value: tmp as u64,
14648 })?;
14649 Ok(__struct)
14650 }
14651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14652 let mut __tmp = BytesMut::new(bytes);
14653 #[allow(clippy::absurd_extreme_comparisons)]
14654 #[allow(unused_comparisons)]
14655 if __tmp.remaining() < Self::ENCODED_LEN {
14656 panic!(
14657 "buffer is too small (need {} bytes, but got {})",
14658 Self::ENCODED_LEN,
14659 __tmp.remaining(),
14660 )
14661 }
14662 __tmp.put_u32_le(self.time_last_baseline_ms);
14663 __tmp.put_u32_le(self.tow);
14664 __tmp.put_i32_le(self.baseline_a_mm);
14665 __tmp.put_i32_le(self.baseline_b_mm);
14666 __tmp.put_i32_le(self.baseline_c_mm);
14667 __tmp.put_u32_le(self.accuracy);
14668 __tmp.put_i32_le(self.iar_num_hypotheses);
14669 __tmp.put_u16_le(self.wn);
14670 __tmp.put_u8(self.rtk_receiver_id);
14671 __tmp.put_u8(self.rtk_health);
14672 __tmp.put_u8(self.rtk_rate);
14673 __tmp.put_u8(self.nsats);
14674 __tmp.put_u8(self.baseline_coords_type as u8);
14675 if matches!(version, MavlinkVersion::V2) {
14676 let len = __tmp.len();
14677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14678 } else {
14679 __tmp.len()
14680 }
14681 }
14682}
14683#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14684#[doc = ""]
14685#[doc = "ID: 49"]
14686#[derive(Debug, Clone, PartialEq)]
14687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14689#[cfg_attr(feature = "ts", derive(TS))]
14690#[cfg_attr(feature = "ts", ts(export))]
14691pub struct GPS_GLOBAL_ORIGIN_DATA {
14692 #[doc = "Latitude (WGS84)"]
14693 pub latitude: i32,
14694 #[doc = "Longitude (WGS84)"]
14695 pub longitude: i32,
14696 #[doc = "Altitude (MSL). Positive for up."]
14697 pub altitude: i32,
14698 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14699 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14700 pub time_usec: u64,
14701}
14702impl GPS_GLOBAL_ORIGIN_DATA {
14703 pub const ENCODED_LEN: usize = 20usize;
14704 pub const DEFAULT: Self = Self {
14705 latitude: 0_i32,
14706 longitude: 0_i32,
14707 altitude: 0_i32,
14708 time_usec: 0_u64,
14709 };
14710 #[cfg(feature = "arbitrary")]
14711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14712 use arbitrary::{Arbitrary, Unstructured};
14713 let mut buf = [0u8; 1024];
14714 rng.fill_bytes(&mut buf);
14715 let mut unstructured = Unstructured::new(&buf);
14716 Self::arbitrary(&mut unstructured).unwrap_or_default()
14717 }
14718}
14719impl Default for GPS_GLOBAL_ORIGIN_DATA {
14720 fn default() -> Self {
14721 Self::DEFAULT.clone()
14722 }
14723}
14724impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14725 type Message = MavMessage;
14726 const ID: u32 = 49u32;
14727 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14728 const EXTRA_CRC: u8 = 39u8;
14729 const ENCODED_LEN: usize = 20usize;
14730 fn deser(
14731 _version: MavlinkVersion,
14732 __input: &[u8],
14733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14734 let avail_len = __input.len();
14735 let mut payload_buf = [0; Self::ENCODED_LEN];
14736 let mut buf = if avail_len < Self::ENCODED_LEN {
14737 payload_buf[0..avail_len].copy_from_slice(__input);
14738 Bytes::new(&payload_buf)
14739 } else {
14740 Bytes::new(__input)
14741 };
14742 let mut __struct = Self::default();
14743 __struct.latitude = buf.get_i32_le()?;
14744 __struct.longitude = buf.get_i32_le()?;
14745 __struct.altitude = buf.get_i32_le()?;
14746 __struct.time_usec = buf.get_u64_le()?;
14747 Ok(__struct)
14748 }
14749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14750 let mut __tmp = BytesMut::new(bytes);
14751 #[allow(clippy::absurd_extreme_comparisons)]
14752 #[allow(unused_comparisons)]
14753 if __tmp.remaining() < Self::ENCODED_LEN {
14754 panic!(
14755 "buffer is too small (need {} bytes, but got {})",
14756 Self::ENCODED_LEN,
14757 __tmp.remaining(),
14758 )
14759 }
14760 __tmp.put_i32_le(self.latitude);
14761 __tmp.put_i32_le(self.longitude);
14762 __tmp.put_i32_le(self.altitude);
14763 if matches!(version, MavlinkVersion::V2) {
14764 __tmp.put_u64_le(self.time_usec);
14765 let len = __tmp.len();
14766 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14767 } else {
14768 __tmp.len()
14769 }
14770 }
14771}
14772#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14773#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14774#[doc = ""]
14775#[doc = "ID: 123"]
14776#[derive(Debug, Clone, PartialEq)]
14777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14778#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14779#[cfg_attr(feature = "ts", derive(TS))]
14780#[cfg_attr(feature = "ts", ts(export))]
14781pub struct GPS_INJECT_DATA_DATA {
14782 #[doc = "System ID"]
14783 pub target_system: u8,
14784 #[doc = "Component ID"]
14785 pub target_component: u8,
14786 #[doc = "Data length"]
14787 pub len: u8,
14788 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14790 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14791 pub data: [u8; 110],
14792}
14793impl GPS_INJECT_DATA_DATA {
14794 pub const ENCODED_LEN: usize = 113usize;
14795 pub const DEFAULT: Self = Self {
14796 target_system: 0_u8,
14797 target_component: 0_u8,
14798 len: 0_u8,
14799 data: [0_u8; 110usize],
14800 };
14801 #[cfg(feature = "arbitrary")]
14802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14803 use arbitrary::{Arbitrary, Unstructured};
14804 let mut buf = [0u8; 1024];
14805 rng.fill_bytes(&mut buf);
14806 let mut unstructured = Unstructured::new(&buf);
14807 Self::arbitrary(&mut unstructured).unwrap_or_default()
14808 }
14809}
14810impl Default for GPS_INJECT_DATA_DATA {
14811 fn default() -> Self {
14812 Self::DEFAULT.clone()
14813 }
14814}
14815impl MessageData for GPS_INJECT_DATA_DATA {
14816 type Message = MavMessage;
14817 const ID: u32 = 123u32;
14818 const NAME: &'static str = "GPS_INJECT_DATA";
14819 const EXTRA_CRC: u8 = 250u8;
14820 const ENCODED_LEN: usize = 113usize;
14821 fn deser(
14822 _version: MavlinkVersion,
14823 __input: &[u8],
14824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14825 let avail_len = __input.len();
14826 let mut payload_buf = [0; Self::ENCODED_LEN];
14827 let mut buf = if avail_len < Self::ENCODED_LEN {
14828 payload_buf[0..avail_len].copy_from_slice(__input);
14829 Bytes::new(&payload_buf)
14830 } else {
14831 Bytes::new(__input)
14832 };
14833 let mut __struct = Self::default();
14834 __struct.target_system = buf.get_u8()?;
14835 __struct.target_component = buf.get_u8()?;
14836 __struct.len = buf.get_u8()?;
14837 for v in &mut __struct.data {
14838 let val = buf.get_u8()?;
14839 *v = val;
14840 }
14841 Ok(__struct)
14842 }
14843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14844 let mut __tmp = BytesMut::new(bytes);
14845 #[allow(clippy::absurd_extreme_comparisons)]
14846 #[allow(unused_comparisons)]
14847 if __tmp.remaining() < Self::ENCODED_LEN {
14848 panic!(
14849 "buffer is too small (need {} bytes, but got {})",
14850 Self::ENCODED_LEN,
14851 __tmp.remaining(),
14852 )
14853 }
14854 __tmp.put_u8(self.target_system);
14855 __tmp.put_u8(self.target_component);
14856 __tmp.put_u8(self.len);
14857 for val in &self.data {
14858 __tmp.put_u8(*val);
14859 }
14860 if matches!(version, MavlinkVersion::V2) {
14861 let len = __tmp.len();
14862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14863 } else {
14864 __tmp.len()
14865 }
14866 }
14867}
14868#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14869#[doc = ""]
14870#[doc = "ID: 232"]
14871#[derive(Debug, Clone, PartialEq)]
14872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14874#[cfg_attr(feature = "ts", derive(TS))]
14875#[cfg_attr(feature = "ts", ts(export))]
14876pub struct GPS_INPUT_DATA {
14877 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14878 pub time_usec: u64,
14879 #[doc = "GPS time (from start of GPS week)"]
14880 pub time_week_ms: u32,
14881 #[doc = "Latitude (WGS84)"]
14882 pub lat: i32,
14883 #[doc = "Longitude (WGS84)"]
14884 pub lon: i32,
14885 #[doc = "Altitude (MSL). Positive for up."]
14886 pub alt: f32,
14887 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14888 pub hdop: f32,
14889 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14890 pub vdop: f32,
14891 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14892 pub vn: f32,
14893 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14894 pub ve: f32,
14895 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14896 pub vd: f32,
14897 #[doc = "GPS speed accuracy"]
14898 pub speed_accuracy: f32,
14899 #[doc = "GPS horizontal accuracy"]
14900 pub horiz_accuracy: f32,
14901 #[doc = "GPS vertical accuracy"]
14902 pub vert_accuracy: f32,
14903 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14904 pub ignore_flags: GpsInputIgnoreFlags,
14905 #[doc = "GPS week number"]
14906 pub time_week: u16,
14907 #[doc = "ID of the GPS for multiple GPS inputs"]
14908 pub gps_id: u8,
14909 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14910 pub fix_type: u8,
14911 #[doc = "Number of satellites visible."]
14912 pub satellites_visible: u8,
14913 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14914 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14915 pub yaw: u16,
14916}
14917impl GPS_INPUT_DATA {
14918 pub const ENCODED_LEN: usize = 65usize;
14919 pub const DEFAULT: Self = Self {
14920 time_usec: 0_u64,
14921 time_week_ms: 0_u32,
14922 lat: 0_i32,
14923 lon: 0_i32,
14924 alt: 0.0_f32,
14925 hdop: 0.0_f32,
14926 vdop: 0.0_f32,
14927 vn: 0.0_f32,
14928 ve: 0.0_f32,
14929 vd: 0.0_f32,
14930 speed_accuracy: 0.0_f32,
14931 horiz_accuracy: 0.0_f32,
14932 vert_accuracy: 0.0_f32,
14933 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14934 time_week: 0_u16,
14935 gps_id: 0_u8,
14936 fix_type: 0_u8,
14937 satellites_visible: 0_u8,
14938 yaw: 0_u16,
14939 };
14940 #[cfg(feature = "arbitrary")]
14941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14942 use arbitrary::{Arbitrary, Unstructured};
14943 let mut buf = [0u8; 1024];
14944 rng.fill_bytes(&mut buf);
14945 let mut unstructured = Unstructured::new(&buf);
14946 Self::arbitrary(&mut unstructured).unwrap_or_default()
14947 }
14948}
14949impl Default for GPS_INPUT_DATA {
14950 fn default() -> Self {
14951 Self::DEFAULT.clone()
14952 }
14953}
14954impl MessageData for GPS_INPUT_DATA {
14955 type Message = MavMessage;
14956 const ID: u32 = 232u32;
14957 const NAME: &'static str = "GPS_INPUT";
14958 const EXTRA_CRC: u8 = 151u8;
14959 const ENCODED_LEN: usize = 65usize;
14960 fn deser(
14961 _version: MavlinkVersion,
14962 __input: &[u8],
14963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14964 let avail_len = __input.len();
14965 let mut payload_buf = [0; Self::ENCODED_LEN];
14966 let mut buf = if avail_len < Self::ENCODED_LEN {
14967 payload_buf[0..avail_len].copy_from_slice(__input);
14968 Bytes::new(&payload_buf)
14969 } else {
14970 Bytes::new(__input)
14971 };
14972 let mut __struct = Self::default();
14973 __struct.time_usec = buf.get_u64_le()?;
14974 __struct.time_week_ms = buf.get_u32_le()?;
14975 __struct.lat = buf.get_i32_le()?;
14976 __struct.lon = buf.get_i32_le()?;
14977 __struct.alt = buf.get_f32_le()?;
14978 __struct.hdop = buf.get_f32_le()?;
14979 __struct.vdop = buf.get_f32_le()?;
14980 __struct.vn = buf.get_f32_le()?;
14981 __struct.ve = buf.get_f32_le()?;
14982 __struct.vd = buf.get_f32_le()?;
14983 __struct.speed_accuracy = buf.get_f32_le()?;
14984 __struct.horiz_accuracy = buf.get_f32_le()?;
14985 __struct.vert_accuracy = buf.get_f32_le()?;
14986 let tmp = buf.get_u16_le()?;
14987 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14988 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
14989 )
14990 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14991 flag_type: "GpsInputIgnoreFlags",
14992 value: tmp as u64,
14993 })?;
14994 __struct.time_week = buf.get_u16_le()?;
14995 __struct.gps_id = buf.get_u8()?;
14996 __struct.fix_type = buf.get_u8()?;
14997 __struct.satellites_visible = buf.get_u8()?;
14998 __struct.yaw = buf.get_u16_le()?;
14999 Ok(__struct)
15000 }
15001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15002 let mut __tmp = BytesMut::new(bytes);
15003 #[allow(clippy::absurd_extreme_comparisons)]
15004 #[allow(unused_comparisons)]
15005 if __tmp.remaining() < Self::ENCODED_LEN {
15006 panic!(
15007 "buffer is too small (need {} bytes, but got {})",
15008 Self::ENCODED_LEN,
15009 __tmp.remaining(),
15010 )
15011 }
15012 __tmp.put_u64_le(self.time_usec);
15013 __tmp.put_u32_le(self.time_week_ms);
15014 __tmp.put_i32_le(self.lat);
15015 __tmp.put_i32_le(self.lon);
15016 __tmp.put_f32_le(self.alt);
15017 __tmp.put_f32_le(self.hdop);
15018 __tmp.put_f32_le(self.vdop);
15019 __tmp.put_f32_le(self.vn);
15020 __tmp.put_f32_le(self.ve);
15021 __tmp.put_f32_le(self.vd);
15022 __tmp.put_f32_le(self.speed_accuracy);
15023 __tmp.put_f32_le(self.horiz_accuracy);
15024 __tmp.put_f32_le(self.vert_accuracy);
15025 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
15026 __tmp.put_u16_le(self.time_week);
15027 __tmp.put_u8(self.gps_id);
15028 __tmp.put_u8(self.fix_type);
15029 __tmp.put_u8(self.satellites_visible);
15030 if matches!(version, MavlinkVersion::V2) {
15031 __tmp.put_u16_le(self.yaw);
15032 let len = __tmp.len();
15033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15034 } else {
15035 __tmp.len()
15036 }
15037 }
15038}
15039#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15040#[doc = ""]
15041#[doc = "ID: 24"]
15042#[derive(Debug, Clone, PartialEq)]
15043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15045#[cfg_attr(feature = "ts", derive(TS))]
15046#[cfg_attr(feature = "ts", ts(export))]
15047pub struct GPS_RAW_INT_DATA {
15048 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15049 pub time_usec: u64,
15050 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
15051 pub lat: i32,
15052 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
15053 pub lon: i32,
15054 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
15055 pub alt: i32,
15056 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15057 pub eph: u16,
15058 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15059 pub epv: u16,
15060 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15061 pub vel: u16,
15062 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15063 pub cog: u16,
15064 #[doc = "GPS fix type."]
15065 pub fix_type: GpsFixType,
15066 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15067 pub satellites_visible: u8,
15068 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15070 pub alt_ellipsoid: i32,
15071 #[doc = "Position uncertainty."]
15072 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15073 pub h_acc: u32,
15074 #[doc = "Altitude uncertainty."]
15075 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15076 pub v_acc: u32,
15077 #[doc = "Speed uncertainty."]
15078 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15079 pub vel_acc: u32,
15080 #[doc = "Heading / track uncertainty"]
15081 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15082 pub hdg_acc: u32,
15083 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15084 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15085 pub yaw: u16,
15086}
15087impl GPS_RAW_INT_DATA {
15088 pub const ENCODED_LEN: usize = 52usize;
15089 pub const DEFAULT: Self = Self {
15090 time_usec: 0_u64,
15091 lat: 0_i32,
15092 lon: 0_i32,
15093 alt: 0_i32,
15094 eph: 0_u16,
15095 epv: 0_u16,
15096 vel: 0_u16,
15097 cog: 0_u16,
15098 fix_type: GpsFixType::DEFAULT,
15099 satellites_visible: 0_u8,
15100 alt_ellipsoid: 0_i32,
15101 h_acc: 0_u32,
15102 v_acc: 0_u32,
15103 vel_acc: 0_u32,
15104 hdg_acc: 0_u32,
15105 yaw: 0_u16,
15106 };
15107 #[cfg(feature = "arbitrary")]
15108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15109 use arbitrary::{Arbitrary, Unstructured};
15110 let mut buf = [0u8; 1024];
15111 rng.fill_bytes(&mut buf);
15112 let mut unstructured = Unstructured::new(&buf);
15113 Self::arbitrary(&mut unstructured).unwrap_or_default()
15114 }
15115}
15116impl Default for GPS_RAW_INT_DATA {
15117 fn default() -> Self {
15118 Self::DEFAULT.clone()
15119 }
15120}
15121impl MessageData for GPS_RAW_INT_DATA {
15122 type Message = MavMessage;
15123 const ID: u32 = 24u32;
15124 const NAME: &'static str = "GPS_RAW_INT";
15125 const EXTRA_CRC: u8 = 24u8;
15126 const ENCODED_LEN: usize = 52usize;
15127 fn deser(
15128 _version: MavlinkVersion,
15129 __input: &[u8],
15130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15131 let avail_len = __input.len();
15132 let mut payload_buf = [0; Self::ENCODED_LEN];
15133 let mut buf = if avail_len < Self::ENCODED_LEN {
15134 payload_buf[0..avail_len].copy_from_slice(__input);
15135 Bytes::new(&payload_buf)
15136 } else {
15137 Bytes::new(__input)
15138 };
15139 let mut __struct = Self::default();
15140 __struct.time_usec = buf.get_u64_le()?;
15141 __struct.lat = buf.get_i32_le()?;
15142 __struct.lon = buf.get_i32_le()?;
15143 __struct.alt = buf.get_i32_le()?;
15144 __struct.eph = buf.get_u16_le()?;
15145 __struct.epv = buf.get_u16_le()?;
15146 __struct.vel = buf.get_u16_le()?;
15147 __struct.cog = buf.get_u16_le()?;
15148 let tmp = buf.get_u8()?;
15149 __struct.fix_type =
15150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15151 enum_type: "GpsFixType",
15152 value: tmp as u64,
15153 })?;
15154 __struct.satellites_visible = buf.get_u8()?;
15155 __struct.alt_ellipsoid = buf.get_i32_le()?;
15156 __struct.h_acc = buf.get_u32_le()?;
15157 __struct.v_acc = buf.get_u32_le()?;
15158 __struct.vel_acc = buf.get_u32_le()?;
15159 __struct.hdg_acc = buf.get_u32_le()?;
15160 __struct.yaw = buf.get_u16_le()?;
15161 Ok(__struct)
15162 }
15163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15164 let mut __tmp = BytesMut::new(bytes);
15165 #[allow(clippy::absurd_extreme_comparisons)]
15166 #[allow(unused_comparisons)]
15167 if __tmp.remaining() < Self::ENCODED_LEN {
15168 panic!(
15169 "buffer is too small (need {} bytes, but got {})",
15170 Self::ENCODED_LEN,
15171 __tmp.remaining(),
15172 )
15173 }
15174 __tmp.put_u64_le(self.time_usec);
15175 __tmp.put_i32_le(self.lat);
15176 __tmp.put_i32_le(self.lon);
15177 __tmp.put_i32_le(self.alt);
15178 __tmp.put_u16_le(self.eph);
15179 __tmp.put_u16_le(self.epv);
15180 __tmp.put_u16_le(self.vel);
15181 __tmp.put_u16_le(self.cog);
15182 __tmp.put_u8(self.fix_type as u8);
15183 __tmp.put_u8(self.satellites_visible);
15184 if matches!(version, MavlinkVersion::V2) {
15185 __tmp.put_i32_le(self.alt_ellipsoid);
15186 __tmp.put_u32_le(self.h_acc);
15187 __tmp.put_u32_le(self.v_acc);
15188 __tmp.put_u32_le(self.vel_acc);
15189 __tmp.put_u32_le(self.hdg_acc);
15190 __tmp.put_u16_le(self.yaw);
15191 let len = __tmp.len();
15192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15193 } else {
15194 __tmp.len()
15195 }
15196 }
15197}
15198#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15199#[doc = ""]
15200#[doc = "ID: 233"]
15201#[derive(Debug, Clone, PartialEq)]
15202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15204#[cfg_attr(feature = "ts", derive(TS))]
15205#[cfg_attr(feature = "ts", ts(export))]
15206pub struct GPS_RTCM_DATA_DATA {
15207 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15208 pub flags: u8,
15209 #[doc = "data length"]
15210 pub len: u8,
15211 #[doc = "RTCM message (may be fragmented)"]
15212 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15213 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15214 pub data: [u8; 180],
15215}
15216impl GPS_RTCM_DATA_DATA {
15217 pub const ENCODED_LEN: usize = 182usize;
15218 pub const DEFAULT: Self = Self {
15219 flags: 0_u8,
15220 len: 0_u8,
15221 data: [0_u8; 180usize],
15222 };
15223 #[cfg(feature = "arbitrary")]
15224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15225 use arbitrary::{Arbitrary, Unstructured};
15226 let mut buf = [0u8; 1024];
15227 rng.fill_bytes(&mut buf);
15228 let mut unstructured = Unstructured::new(&buf);
15229 Self::arbitrary(&mut unstructured).unwrap_or_default()
15230 }
15231}
15232impl Default for GPS_RTCM_DATA_DATA {
15233 fn default() -> Self {
15234 Self::DEFAULT.clone()
15235 }
15236}
15237impl MessageData for GPS_RTCM_DATA_DATA {
15238 type Message = MavMessage;
15239 const ID: u32 = 233u32;
15240 const NAME: &'static str = "GPS_RTCM_DATA";
15241 const EXTRA_CRC: u8 = 35u8;
15242 const ENCODED_LEN: usize = 182usize;
15243 fn deser(
15244 _version: MavlinkVersion,
15245 __input: &[u8],
15246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15247 let avail_len = __input.len();
15248 let mut payload_buf = [0; Self::ENCODED_LEN];
15249 let mut buf = if avail_len < Self::ENCODED_LEN {
15250 payload_buf[0..avail_len].copy_from_slice(__input);
15251 Bytes::new(&payload_buf)
15252 } else {
15253 Bytes::new(__input)
15254 };
15255 let mut __struct = Self::default();
15256 __struct.flags = buf.get_u8()?;
15257 __struct.len = buf.get_u8()?;
15258 for v in &mut __struct.data {
15259 let val = buf.get_u8()?;
15260 *v = val;
15261 }
15262 Ok(__struct)
15263 }
15264 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15265 let mut __tmp = BytesMut::new(bytes);
15266 #[allow(clippy::absurd_extreme_comparisons)]
15267 #[allow(unused_comparisons)]
15268 if __tmp.remaining() < Self::ENCODED_LEN {
15269 panic!(
15270 "buffer is too small (need {} bytes, but got {})",
15271 Self::ENCODED_LEN,
15272 __tmp.remaining(),
15273 )
15274 }
15275 __tmp.put_u8(self.flags);
15276 __tmp.put_u8(self.len);
15277 for val in &self.data {
15278 __tmp.put_u8(*val);
15279 }
15280 if matches!(version, MavlinkVersion::V2) {
15281 let len = __tmp.len();
15282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15283 } else {
15284 __tmp.len()
15285 }
15286 }
15287}
15288#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15289#[doc = ""]
15290#[doc = "ID: 127"]
15291#[derive(Debug, Clone, PartialEq)]
15292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15294#[cfg_attr(feature = "ts", derive(TS))]
15295#[cfg_attr(feature = "ts", ts(export))]
15296pub struct GPS_RTK_DATA {
15297 #[doc = "Time since boot of last baseline message received."]
15298 pub time_last_baseline_ms: u32,
15299 #[doc = "GPS Time of Week of last baseline"]
15300 pub tow: u32,
15301 #[doc = "Current baseline in ECEF x or NED north component."]
15302 pub baseline_a_mm: i32,
15303 #[doc = "Current baseline in ECEF y or NED east component."]
15304 pub baseline_b_mm: i32,
15305 #[doc = "Current baseline in ECEF z or NED down component."]
15306 pub baseline_c_mm: i32,
15307 #[doc = "Current estimate of baseline accuracy."]
15308 pub accuracy: u32,
15309 #[doc = "Current number of integer ambiguity hypotheses."]
15310 pub iar_num_hypotheses: i32,
15311 #[doc = "GPS Week Number of last baseline"]
15312 pub wn: u16,
15313 #[doc = "Identification of connected RTK receiver."]
15314 pub rtk_receiver_id: u8,
15315 #[doc = "GPS-specific health report for RTK data."]
15316 pub rtk_health: u8,
15317 #[doc = "Rate of baseline messages being received by GPS"]
15318 pub rtk_rate: u8,
15319 #[doc = "Current number of sats used for RTK calculation."]
15320 pub nsats: u8,
15321 #[doc = "Coordinate system of baseline"]
15322 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15323}
15324impl GPS_RTK_DATA {
15325 pub const ENCODED_LEN: usize = 35usize;
15326 pub const DEFAULT: Self = Self {
15327 time_last_baseline_ms: 0_u32,
15328 tow: 0_u32,
15329 baseline_a_mm: 0_i32,
15330 baseline_b_mm: 0_i32,
15331 baseline_c_mm: 0_i32,
15332 accuracy: 0_u32,
15333 iar_num_hypotheses: 0_i32,
15334 wn: 0_u16,
15335 rtk_receiver_id: 0_u8,
15336 rtk_health: 0_u8,
15337 rtk_rate: 0_u8,
15338 nsats: 0_u8,
15339 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15340 };
15341 #[cfg(feature = "arbitrary")]
15342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15343 use arbitrary::{Arbitrary, Unstructured};
15344 let mut buf = [0u8; 1024];
15345 rng.fill_bytes(&mut buf);
15346 let mut unstructured = Unstructured::new(&buf);
15347 Self::arbitrary(&mut unstructured).unwrap_or_default()
15348 }
15349}
15350impl Default for GPS_RTK_DATA {
15351 fn default() -> Self {
15352 Self::DEFAULT.clone()
15353 }
15354}
15355impl MessageData for GPS_RTK_DATA {
15356 type Message = MavMessage;
15357 const ID: u32 = 127u32;
15358 const NAME: &'static str = "GPS_RTK";
15359 const EXTRA_CRC: u8 = 25u8;
15360 const ENCODED_LEN: usize = 35usize;
15361 fn deser(
15362 _version: MavlinkVersion,
15363 __input: &[u8],
15364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15365 let avail_len = __input.len();
15366 let mut payload_buf = [0; Self::ENCODED_LEN];
15367 let mut buf = if avail_len < Self::ENCODED_LEN {
15368 payload_buf[0..avail_len].copy_from_slice(__input);
15369 Bytes::new(&payload_buf)
15370 } else {
15371 Bytes::new(__input)
15372 };
15373 let mut __struct = Self::default();
15374 __struct.time_last_baseline_ms = buf.get_u32_le()?;
15375 __struct.tow = buf.get_u32_le()?;
15376 __struct.baseline_a_mm = buf.get_i32_le()?;
15377 __struct.baseline_b_mm = buf.get_i32_le()?;
15378 __struct.baseline_c_mm = buf.get_i32_le()?;
15379 __struct.accuracy = buf.get_u32_le()?;
15380 __struct.iar_num_hypotheses = buf.get_i32_le()?;
15381 __struct.wn = buf.get_u16_le()?;
15382 __struct.rtk_receiver_id = buf.get_u8()?;
15383 __struct.rtk_health = buf.get_u8()?;
15384 __struct.rtk_rate = buf.get_u8()?;
15385 __struct.nsats = buf.get_u8()?;
15386 let tmp = buf.get_u8()?;
15387 __struct.baseline_coords_type =
15388 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15389 enum_type: "RtkBaselineCoordinateSystem",
15390 value: tmp as u64,
15391 })?;
15392 Ok(__struct)
15393 }
15394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15395 let mut __tmp = BytesMut::new(bytes);
15396 #[allow(clippy::absurd_extreme_comparisons)]
15397 #[allow(unused_comparisons)]
15398 if __tmp.remaining() < Self::ENCODED_LEN {
15399 panic!(
15400 "buffer is too small (need {} bytes, but got {})",
15401 Self::ENCODED_LEN,
15402 __tmp.remaining(),
15403 )
15404 }
15405 __tmp.put_u32_le(self.time_last_baseline_ms);
15406 __tmp.put_u32_le(self.tow);
15407 __tmp.put_i32_le(self.baseline_a_mm);
15408 __tmp.put_i32_le(self.baseline_b_mm);
15409 __tmp.put_i32_le(self.baseline_c_mm);
15410 __tmp.put_u32_le(self.accuracy);
15411 __tmp.put_i32_le(self.iar_num_hypotheses);
15412 __tmp.put_u16_le(self.wn);
15413 __tmp.put_u8(self.rtk_receiver_id);
15414 __tmp.put_u8(self.rtk_health);
15415 __tmp.put_u8(self.rtk_rate);
15416 __tmp.put_u8(self.nsats);
15417 __tmp.put_u8(self.baseline_coords_type as u8);
15418 if matches!(version, MavlinkVersion::V2) {
15419 let len = __tmp.len();
15420 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15421 } else {
15422 __tmp.len()
15423 }
15424 }
15425}
15426#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15427#[doc = ""]
15428#[doc = "ID: 25"]
15429#[derive(Debug, Clone, PartialEq)]
15430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15432#[cfg_attr(feature = "ts", derive(TS))]
15433#[cfg_attr(feature = "ts", ts(export))]
15434pub struct GPS_STATUS_DATA {
15435 #[doc = "Number of satellites visible"]
15436 pub satellites_visible: u8,
15437 #[doc = "Global satellite ID"]
15438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15439 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15440 pub satellite_prn: [u8; 20],
15441 #[doc = "0: Satellite not used, 1: used for localization"]
15442 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15443 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15444 pub satellite_used: [u8; 20],
15445 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15446 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15447 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15448 pub satellite_elevation: [u8; 20],
15449 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15451 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15452 pub satellite_azimuth: [u8; 20],
15453 #[doc = "Signal to noise ratio of satellite"]
15454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15455 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15456 pub satellite_snr: [u8; 20],
15457}
15458impl GPS_STATUS_DATA {
15459 pub const ENCODED_LEN: usize = 101usize;
15460 pub const DEFAULT: Self = Self {
15461 satellites_visible: 0_u8,
15462 satellite_prn: [0_u8; 20usize],
15463 satellite_used: [0_u8; 20usize],
15464 satellite_elevation: [0_u8; 20usize],
15465 satellite_azimuth: [0_u8; 20usize],
15466 satellite_snr: [0_u8; 20usize],
15467 };
15468 #[cfg(feature = "arbitrary")]
15469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15470 use arbitrary::{Arbitrary, Unstructured};
15471 let mut buf = [0u8; 1024];
15472 rng.fill_bytes(&mut buf);
15473 let mut unstructured = Unstructured::new(&buf);
15474 Self::arbitrary(&mut unstructured).unwrap_or_default()
15475 }
15476}
15477impl Default for GPS_STATUS_DATA {
15478 fn default() -> Self {
15479 Self::DEFAULT.clone()
15480 }
15481}
15482impl MessageData for GPS_STATUS_DATA {
15483 type Message = MavMessage;
15484 const ID: u32 = 25u32;
15485 const NAME: &'static str = "GPS_STATUS";
15486 const EXTRA_CRC: u8 = 23u8;
15487 const ENCODED_LEN: usize = 101usize;
15488 fn deser(
15489 _version: MavlinkVersion,
15490 __input: &[u8],
15491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15492 let avail_len = __input.len();
15493 let mut payload_buf = [0; Self::ENCODED_LEN];
15494 let mut buf = if avail_len < Self::ENCODED_LEN {
15495 payload_buf[0..avail_len].copy_from_slice(__input);
15496 Bytes::new(&payload_buf)
15497 } else {
15498 Bytes::new(__input)
15499 };
15500 let mut __struct = Self::default();
15501 __struct.satellites_visible = buf.get_u8()?;
15502 for v in &mut __struct.satellite_prn {
15503 let val = buf.get_u8()?;
15504 *v = val;
15505 }
15506 for v in &mut __struct.satellite_used {
15507 let val = buf.get_u8()?;
15508 *v = val;
15509 }
15510 for v in &mut __struct.satellite_elevation {
15511 let val = buf.get_u8()?;
15512 *v = val;
15513 }
15514 for v in &mut __struct.satellite_azimuth {
15515 let val = buf.get_u8()?;
15516 *v = val;
15517 }
15518 for v in &mut __struct.satellite_snr {
15519 let val = buf.get_u8()?;
15520 *v = val;
15521 }
15522 Ok(__struct)
15523 }
15524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15525 let mut __tmp = BytesMut::new(bytes);
15526 #[allow(clippy::absurd_extreme_comparisons)]
15527 #[allow(unused_comparisons)]
15528 if __tmp.remaining() < Self::ENCODED_LEN {
15529 panic!(
15530 "buffer is too small (need {} bytes, but got {})",
15531 Self::ENCODED_LEN,
15532 __tmp.remaining(),
15533 )
15534 }
15535 __tmp.put_u8(self.satellites_visible);
15536 for val in &self.satellite_prn {
15537 __tmp.put_u8(*val);
15538 }
15539 for val in &self.satellite_used {
15540 __tmp.put_u8(*val);
15541 }
15542 for val in &self.satellite_elevation {
15543 __tmp.put_u8(*val);
15544 }
15545 for val in &self.satellite_azimuth {
15546 __tmp.put_u8(*val);
15547 }
15548 for val in &self.satellite_snr {
15549 __tmp.put_u8(*val);
15550 }
15551 if matches!(version, MavlinkVersion::V2) {
15552 let len = __tmp.len();
15553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15554 } else {
15555 __tmp.len()
15556 }
15557 }
15558}
15559#[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_END."]
15560#[doc = ""]
15561#[doc = "ID: 415"]
15562#[derive(Debug, Clone, PartialEq)]
15563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15565#[cfg_attr(feature = "ts", derive(TS))]
15566#[cfg_attr(feature = "ts", ts(export))]
15567pub struct GROUP_END_DATA {
15568 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15569 pub time_usec: u64,
15570 #[doc = "Mission-unique group id (from MAV_CMD_GROUP_END)."]
15571 pub group_id: u32,
15572 #[doc = "CRC32 checksum of current plan for MAV_MISSION_TYPE_ALL. As defined in MISSION_CHECKSUM message."]
15573 pub mission_checksum: u32,
15574}
15575impl GROUP_END_DATA {
15576 pub const ENCODED_LEN: usize = 16usize;
15577 pub const DEFAULT: Self = Self {
15578 time_usec: 0_u64,
15579 group_id: 0_u32,
15580 mission_checksum: 0_u32,
15581 };
15582 #[cfg(feature = "arbitrary")]
15583 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15584 use arbitrary::{Arbitrary, Unstructured};
15585 let mut buf = [0u8; 1024];
15586 rng.fill_bytes(&mut buf);
15587 let mut unstructured = Unstructured::new(&buf);
15588 Self::arbitrary(&mut unstructured).unwrap_or_default()
15589 }
15590}
15591impl Default for GROUP_END_DATA {
15592 fn default() -> Self {
15593 Self::DEFAULT.clone()
15594 }
15595}
15596impl MessageData for GROUP_END_DATA {
15597 type Message = MavMessage;
15598 const ID: u32 = 415u32;
15599 const NAME: &'static str = "GROUP_END";
15600 const EXTRA_CRC: u8 = 161u8;
15601 const ENCODED_LEN: usize = 16usize;
15602 fn deser(
15603 _version: MavlinkVersion,
15604 __input: &[u8],
15605 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15606 let avail_len = __input.len();
15607 let mut payload_buf = [0; Self::ENCODED_LEN];
15608 let mut buf = if avail_len < Self::ENCODED_LEN {
15609 payload_buf[0..avail_len].copy_from_slice(__input);
15610 Bytes::new(&payload_buf)
15611 } else {
15612 Bytes::new(__input)
15613 };
15614 let mut __struct = Self::default();
15615 __struct.time_usec = buf.get_u64_le()?;
15616 __struct.group_id = buf.get_u32_le()?;
15617 __struct.mission_checksum = buf.get_u32_le()?;
15618 Ok(__struct)
15619 }
15620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15621 let mut __tmp = BytesMut::new(bytes);
15622 #[allow(clippy::absurd_extreme_comparisons)]
15623 #[allow(unused_comparisons)]
15624 if __tmp.remaining() < Self::ENCODED_LEN {
15625 panic!(
15626 "buffer is too small (need {} bytes, but got {})",
15627 Self::ENCODED_LEN,
15628 __tmp.remaining(),
15629 )
15630 }
15631 __tmp.put_u64_le(self.time_usec);
15632 __tmp.put_u32_le(self.group_id);
15633 __tmp.put_u32_le(self.mission_checksum);
15634 if matches!(version, MavlinkVersion::V2) {
15635 let len = __tmp.len();
15636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15637 } else {
15638 __tmp.len()
15639 }
15640 }
15641}
15642#[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_START."]
15643#[doc = ""]
15644#[doc = "ID: 414"]
15645#[derive(Debug, Clone, PartialEq)]
15646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15648#[cfg_attr(feature = "ts", derive(TS))]
15649#[cfg_attr(feature = "ts", ts(export))]
15650pub struct GROUP_START_DATA {
15651 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15652 pub time_usec: u64,
15653 #[doc = "Mission-unique group id (from MAV_CMD_GROUP_START)."]
15654 pub group_id: u32,
15655 #[doc = "CRC32 checksum of current plan for MAV_MISSION_TYPE_ALL. As defined in MISSION_CHECKSUM message."]
15656 pub mission_checksum: u32,
15657}
15658impl GROUP_START_DATA {
15659 pub const ENCODED_LEN: usize = 16usize;
15660 pub const DEFAULT: Self = Self {
15661 time_usec: 0_u64,
15662 group_id: 0_u32,
15663 mission_checksum: 0_u32,
15664 };
15665 #[cfg(feature = "arbitrary")]
15666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15667 use arbitrary::{Arbitrary, Unstructured};
15668 let mut buf = [0u8; 1024];
15669 rng.fill_bytes(&mut buf);
15670 let mut unstructured = Unstructured::new(&buf);
15671 Self::arbitrary(&mut unstructured).unwrap_or_default()
15672 }
15673}
15674impl Default for GROUP_START_DATA {
15675 fn default() -> Self {
15676 Self::DEFAULT.clone()
15677 }
15678}
15679impl MessageData for GROUP_START_DATA {
15680 type Message = MavMessage;
15681 const ID: u32 = 414u32;
15682 const NAME: &'static str = "GROUP_START";
15683 const EXTRA_CRC: u8 = 109u8;
15684 const ENCODED_LEN: usize = 16usize;
15685 fn deser(
15686 _version: MavlinkVersion,
15687 __input: &[u8],
15688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15689 let avail_len = __input.len();
15690 let mut payload_buf = [0; Self::ENCODED_LEN];
15691 let mut buf = if avail_len < Self::ENCODED_LEN {
15692 payload_buf[0..avail_len].copy_from_slice(__input);
15693 Bytes::new(&payload_buf)
15694 } else {
15695 Bytes::new(__input)
15696 };
15697 let mut __struct = Self::default();
15698 __struct.time_usec = buf.get_u64_le()?;
15699 __struct.group_id = buf.get_u32_le()?;
15700 __struct.mission_checksum = buf.get_u32_le()?;
15701 Ok(__struct)
15702 }
15703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15704 let mut __tmp = BytesMut::new(bytes);
15705 #[allow(clippy::absurd_extreme_comparisons)]
15706 #[allow(unused_comparisons)]
15707 if __tmp.remaining() < Self::ENCODED_LEN {
15708 panic!(
15709 "buffer is too small (need {} bytes, but got {})",
15710 Self::ENCODED_LEN,
15711 __tmp.remaining(),
15712 )
15713 }
15714 __tmp.put_u64_le(self.time_usec);
15715 __tmp.put_u32_le(self.group_id);
15716 __tmp.put_u32_le(self.mission_checksum);
15717 if matches!(version, MavlinkVersion::V2) {
15718 let len = __tmp.len();
15719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15720 } else {
15721 __tmp.len()
15722 }
15723 }
15724}
15725#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15726#[doc = ""]
15727#[doc = "ID: 0"]
15728#[derive(Debug, Clone, PartialEq)]
15729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15731#[cfg_attr(feature = "ts", derive(TS))]
15732#[cfg_attr(feature = "ts", ts(export))]
15733pub struct HEARTBEAT_DATA {
15734 #[doc = "A bitfield for use for autopilot-specific flags"]
15735 pub custom_mode: u32,
15736 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15737 pub mavtype: MavType,
15738 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15739 pub autopilot: MavAutopilot,
15740 #[doc = "System mode bitmap."]
15741 pub base_mode: MavModeFlag,
15742 #[doc = "System status flag."]
15743 pub system_status: MavState,
15744 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15745 pub mavlink_version: u8,
15746}
15747impl HEARTBEAT_DATA {
15748 pub const ENCODED_LEN: usize = 9usize;
15749 pub const DEFAULT: Self = Self {
15750 custom_mode: 0_u32,
15751 mavtype: MavType::DEFAULT,
15752 autopilot: MavAutopilot::DEFAULT,
15753 base_mode: MavModeFlag::DEFAULT,
15754 system_status: MavState::DEFAULT,
15755 mavlink_version: MINOR_MAVLINK_VERSION,
15756 };
15757 #[cfg(feature = "arbitrary")]
15758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15759 use arbitrary::{Arbitrary, Unstructured};
15760 let mut buf = [0u8; 1024];
15761 rng.fill_bytes(&mut buf);
15762 let mut unstructured = Unstructured::new(&buf);
15763 Self::arbitrary(&mut unstructured).unwrap_or_default()
15764 }
15765}
15766impl Default for HEARTBEAT_DATA {
15767 fn default() -> Self {
15768 Self::DEFAULT.clone()
15769 }
15770}
15771impl MessageData for HEARTBEAT_DATA {
15772 type Message = MavMessage;
15773 const ID: u32 = 0u32;
15774 const NAME: &'static str = "HEARTBEAT";
15775 const EXTRA_CRC: u8 = 50u8;
15776 const ENCODED_LEN: usize = 9usize;
15777 fn deser(
15778 _version: MavlinkVersion,
15779 __input: &[u8],
15780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15781 let avail_len = __input.len();
15782 let mut payload_buf = [0; Self::ENCODED_LEN];
15783 let mut buf = if avail_len < Self::ENCODED_LEN {
15784 payload_buf[0..avail_len].copy_from_slice(__input);
15785 Bytes::new(&payload_buf)
15786 } else {
15787 Bytes::new(__input)
15788 };
15789 let mut __struct = Self::default();
15790 __struct.custom_mode = buf.get_u32_le()?;
15791 let tmp = buf.get_u8()?;
15792 __struct.mavtype =
15793 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15794 enum_type: "MavType",
15795 value: tmp as u64,
15796 })?;
15797 let tmp = buf.get_u8()?;
15798 __struct.autopilot =
15799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15800 enum_type: "MavAutopilot",
15801 value: tmp as u64,
15802 })?;
15803 let tmp = buf.get_u8()?;
15804 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15805 ::mavlink_core::error::ParserError::InvalidFlag {
15806 flag_type: "MavModeFlag",
15807 value: tmp as u64,
15808 },
15809 )?;
15810 let tmp = buf.get_u8()?;
15811 __struct.system_status =
15812 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15813 enum_type: "MavState",
15814 value: tmp as u64,
15815 })?;
15816 __struct.mavlink_version = buf.get_u8()?;
15817 Ok(__struct)
15818 }
15819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15820 let mut __tmp = BytesMut::new(bytes);
15821 #[allow(clippy::absurd_extreme_comparisons)]
15822 #[allow(unused_comparisons)]
15823 if __tmp.remaining() < Self::ENCODED_LEN {
15824 panic!(
15825 "buffer is too small (need {} bytes, but got {})",
15826 Self::ENCODED_LEN,
15827 __tmp.remaining(),
15828 )
15829 }
15830 __tmp.put_u32_le(self.custom_mode);
15831 __tmp.put_u8(self.mavtype as u8);
15832 __tmp.put_u8(self.autopilot as u8);
15833 __tmp.put_u8(self.base_mode.bits() as u8);
15834 __tmp.put_u8(self.system_status as u8);
15835 __tmp.put_u8(self.mavlink_version);
15836 if matches!(version, MavlinkVersion::V2) {
15837 let len = __tmp.len();
15838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15839 } else {
15840 __tmp.len()
15841 }
15842 }
15843}
15844#[doc = "The IMU readings in SI units in NED body frame."]
15845#[doc = ""]
15846#[doc = "ID: 105"]
15847#[derive(Debug, Clone, PartialEq)]
15848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15850#[cfg_attr(feature = "ts", derive(TS))]
15851#[cfg_attr(feature = "ts", ts(export))]
15852pub struct HIGHRES_IMU_DATA {
15853 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15854 pub time_usec: u64,
15855 #[doc = "X acceleration"]
15856 pub xacc: f32,
15857 #[doc = "Y acceleration"]
15858 pub yacc: f32,
15859 #[doc = "Z acceleration"]
15860 pub zacc: f32,
15861 #[doc = "Angular speed around X axis"]
15862 pub xgyro: f32,
15863 #[doc = "Angular speed around Y axis"]
15864 pub ygyro: f32,
15865 #[doc = "Angular speed around Z axis"]
15866 pub zgyro: f32,
15867 #[doc = "X Magnetic field"]
15868 pub xmag: f32,
15869 #[doc = "Y Magnetic field"]
15870 pub ymag: f32,
15871 #[doc = "Z Magnetic field"]
15872 pub zmag: f32,
15873 #[doc = "Absolute pressure"]
15874 pub abs_pressure: f32,
15875 #[doc = "Differential pressure"]
15876 pub diff_pressure: f32,
15877 #[doc = "Altitude calculated from pressure"]
15878 pub pressure_alt: f32,
15879 #[doc = "Temperature"]
15880 pub temperature: f32,
15881 #[doc = "Bitmap for fields that have updated since last message"]
15882 pub fields_updated: HighresImuUpdatedFlags,
15883 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15884 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15885 pub id: u8,
15886}
15887impl HIGHRES_IMU_DATA {
15888 pub const ENCODED_LEN: usize = 63usize;
15889 pub const DEFAULT: Self = Self {
15890 time_usec: 0_u64,
15891 xacc: 0.0_f32,
15892 yacc: 0.0_f32,
15893 zacc: 0.0_f32,
15894 xgyro: 0.0_f32,
15895 ygyro: 0.0_f32,
15896 zgyro: 0.0_f32,
15897 xmag: 0.0_f32,
15898 ymag: 0.0_f32,
15899 zmag: 0.0_f32,
15900 abs_pressure: 0.0_f32,
15901 diff_pressure: 0.0_f32,
15902 pressure_alt: 0.0_f32,
15903 temperature: 0.0_f32,
15904 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15905 id: 0_u8,
15906 };
15907 #[cfg(feature = "arbitrary")]
15908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15909 use arbitrary::{Arbitrary, Unstructured};
15910 let mut buf = [0u8; 1024];
15911 rng.fill_bytes(&mut buf);
15912 let mut unstructured = Unstructured::new(&buf);
15913 Self::arbitrary(&mut unstructured).unwrap_or_default()
15914 }
15915}
15916impl Default for HIGHRES_IMU_DATA {
15917 fn default() -> Self {
15918 Self::DEFAULT.clone()
15919 }
15920}
15921impl MessageData for HIGHRES_IMU_DATA {
15922 type Message = MavMessage;
15923 const ID: u32 = 105u32;
15924 const NAME: &'static str = "HIGHRES_IMU";
15925 const EXTRA_CRC: u8 = 93u8;
15926 const ENCODED_LEN: usize = 63usize;
15927 fn deser(
15928 _version: MavlinkVersion,
15929 __input: &[u8],
15930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15931 let avail_len = __input.len();
15932 let mut payload_buf = [0; Self::ENCODED_LEN];
15933 let mut buf = if avail_len < Self::ENCODED_LEN {
15934 payload_buf[0..avail_len].copy_from_slice(__input);
15935 Bytes::new(&payload_buf)
15936 } else {
15937 Bytes::new(__input)
15938 };
15939 let mut __struct = Self::default();
15940 __struct.time_usec = buf.get_u64_le()?;
15941 __struct.xacc = buf.get_f32_le()?;
15942 __struct.yacc = buf.get_f32_le()?;
15943 __struct.zacc = buf.get_f32_le()?;
15944 __struct.xgyro = buf.get_f32_le()?;
15945 __struct.ygyro = buf.get_f32_le()?;
15946 __struct.zgyro = buf.get_f32_le()?;
15947 __struct.xmag = buf.get_f32_le()?;
15948 __struct.ymag = buf.get_f32_le()?;
15949 __struct.zmag = buf.get_f32_le()?;
15950 __struct.abs_pressure = buf.get_f32_le()?;
15951 __struct.diff_pressure = buf.get_f32_le()?;
15952 __struct.pressure_alt = buf.get_f32_le()?;
15953 __struct.temperature = buf.get_f32_le()?;
15954 let tmp = buf.get_u16_le()?;
15955 __struct.fields_updated =
15956 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15957 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15958 flag_type: "HighresImuUpdatedFlags",
15959 value: tmp as u64,
15960 })?;
15961 __struct.id = buf.get_u8()?;
15962 Ok(__struct)
15963 }
15964 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15965 let mut __tmp = BytesMut::new(bytes);
15966 #[allow(clippy::absurd_extreme_comparisons)]
15967 #[allow(unused_comparisons)]
15968 if __tmp.remaining() < Self::ENCODED_LEN {
15969 panic!(
15970 "buffer is too small (need {} bytes, but got {})",
15971 Self::ENCODED_LEN,
15972 __tmp.remaining(),
15973 )
15974 }
15975 __tmp.put_u64_le(self.time_usec);
15976 __tmp.put_f32_le(self.xacc);
15977 __tmp.put_f32_le(self.yacc);
15978 __tmp.put_f32_le(self.zacc);
15979 __tmp.put_f32_le(self.xgyro);
15980 __tmp.put_f32_le(self.ygyro);
15981 __tmp.put_f32_le(self.zgyro);
15982 __tmp.put_f32_le(self.xmag);
15983 __tmp.put_f32_le(self.ymag);
15984 __tmp.put_f32_le(self.zmag);
15985 __tmp.put_f32_le(self.abs_pressure);
15986 __tmp.put_f32_le(self.diff_pressure);
15987 __tmp.put_f32_le(self.pressure_alt);
15988 __tmp.put_f32_le(self.temperature);
15989 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15990 if matches!(version, MavlinkVersion::V2) {
15991 __tmp.put_u8(self.id);
15992 let len = __tmp.len();
15993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15994 } else {
15995 __tmp.len()
15996 }
15997 }
15998}
15999#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
16000#[doc = "Message appropriate for high latency connections like Iridium."]
16001#[doc = ""]
16002#[doc = "ID: 234"]
16003#[derive(Debug, Clone, PartialEq)]
16004#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16006#[cfg_attr(feature = "ts", derive(TS))]
16007#[cfg_attr(feature = "ts", ts(export))]
16008pub struct HIGH_LATENCY_DATA {
16009 #[doc = "A bitfield for use for autopilot-specific flags."]
16010 pub custom_mode: u32,
16011 #[doc = "Latitude"]
16012 pub latitude: i32,
16013 #[doc = "Longitude"]
16014 pub longitude: i32,
16015 #[doc = "roll"]
16016 pub roll: i16,
16017 #[doc = "pitch"]
16018 pub pitch: i16,
16019 #[doc = "heading"]
16020 pub heading: u16,
16021 #[doc = "heading setpoint"]
16022 pub heading_sp: i16,
16023 #[doc = "Altitude above mean sea level"]
16024 pub altitude_amsl: i16,
16025 #[doc = "Altitude setpoint relative to the home position"]
16026 pub altitude_sp: i16,
16027 #[doc = "distance to target"]
16028 pub wp_distance: u16,
16029 #[doc = "Bitmap of enabled system modes."]
16030 pub base_mode: MavModeFlag,
16031 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16032 pub landed_state: MavLandedState,
16033 #[doc = "throttle (percentage)"]
16034 pub throttle: i8,
16035 #[doc = "airspeed"]
16036 pub airspeed: u8,
16037 #[doc = "airspeed setpoint"]
16038 pub airspeed_sp: u8,
16039 #[doc = "groundspeed"]
16040 pub groundspeed: u8,
16041 #[doc = "climb rate"]
16042 pub climb_rate: i8,
16043 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16044 pub gps_nsat: u8,
16045 #[doc = "GPS Fix type."]
16046 pub gps_fix_type: GpsFixType,
16047 #[doc = "Remaining battery (percentage)"]
16048 pub battery_remaining: u8,
16049 #[doc = "Autopilot temperature (degrees C)"]
16050 pub temperature: i8,
16051 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16052 pub temperature_air: i8,
16053 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16054 pub failsafe: u8,
16055 #[doc = "current waypoint number"]
16056 pub wp_num: u8,
16057}
16058impl HIGH_LATENCY_DATA {
16059 pub const ENCODED_LEN: usize = 40usize;
16060 pub const DEFAULT: Self = Self {
16061 custom_mode: 0_u32,
16062 latitude: 0_i32,
16063 longitude: 0_i32,
16064 roll: 0_i16,
16065 pitch: 0_i16,
16066 heading: 0_u16,
16067 heading_sp: 0_i16,
16068 altitude_amsl: 0_i16,
16069 altitude_sp: 0_i16,
16070 wp_distance: 0_u16,
16071 base_mode: MavModeFlag::DEFAULT,
16072 landed_state: MavLandedState::DEFAULT,
16073 throttle: 0_i8,
16074 airspeed: 0_u8,
16075 airspeed_sp: 0_u8,
16076 groundspeed: 0_u8,
16077 climb_rate: 0_i8,
16078 gps_nsat: 0_u8,
16079 gps_fix_type: GpsFixType::DEFAULT,
16080 battery_remaining: 0_u8,
16081 temperature: 0_i8,
16082 temperature_air: 0_i8,
16083 failsafe: 0_u8,
16084 wp_num: 0_u8,
16085 };
16086 #[cfg(feature = "arbitrary")]
16087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16088 use arbitrary::{Arbitrary, Unstructured};
16089 let mut buf = [0u8; 1024];
16090 rng.fill_bytes(&mut buf);
16091 let mut unstructured = Unstructured::new(&buf);
16092 Self::arbitrary(&mut unstructured).unwrap_or_default()
16093 }
16094}
16095impl Default for HIGH_LATENCY_DATA {
16096 fn default() -> Self {
16097 Self::DEFAULT.clone()
16098 }
16099}
16100impl MessageData for HIGH_LATENCY_DATA {
16101 type Message = MavMessage;
16102 const ID: u32 = 234u32;
16103 const NAME: &'static str = "HIGH_LATENCY";
16104 const EXTRA_CRC: u8 = 150u8;
16105 const ENCODED_LEN: usize = 40usize;
16106 fn deser(
16107 _version: MavlinkVersion,
16108 __input: &[u8],
16109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16110 let avail_len = __input.len();
16111 let mut payload_buf = [0; Self::ENCODED_LEN];
16112 let mut buf = if avail_len < Self::ENCODED_LEN {
16113 payload_buf[0..avail_len].copy_from_slice(__input);
16114 Bytes::new(&payload_buf)
16115 } else {
16116 Bytes::new(__input)
16117 };
16118 let mut __struct = Self::default();
16119 __struct.custom_mode = buf.get_u32_le()?;
16120 __struct.latitude = buf.get_i32_le()?;
16121 __struct.longitude = buf.get_i32_le()?;
16122 __struct.roll = buf.get_i16_le()?;
16123 __struct.pitch = buf.get_i16_le()?;
16124 __struct.heading = buf.get_u16_le()?;
16125 __struct.heading_sp = buf.get_i16_le()?;
16126 __struct.altitude_amsl = buf.get_i16_le()?;
16127 __struct.altitude_sp = buf.get_i16_le()?;
16128 __struct.wp_distance = buf.get_u16_le()?;
16129 let tmp = buf.get_u8()?;
16130 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16131 ::mavlink_core::error::ParserError::InvalidFlag {
16132 flag_type: "MavModeFlag",
16133 value: tmp as u64,
16134 },
16135 )?;
16136 let tmp = buf.get_u8()?;
16137 __struct.landed_state =
16138 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16139 enum_type: "MavLandedState",
16140 value: tmp as u64,
16141 })?;
16142 __struct.throttle = buf.get_i8()?;
16143 __struct.airspeed = buf.get_u8()?;
16144 __struct.airspeed_sp = buf.get_u8()?;
16145 __struct.groundspeed = buf.get_u8()?;
16146 __struct.climb_rate = buf.get_i8()?;
16147 __struct.gps_nsat = buf.get_u8()?;
16148 let tmp = buf.get_u8()?;
16149 __struct.gps_fix_type =
16150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16151 enum_type: "GpsFixType",
16152 value: tmp as u64,
16153 })?;
16154 __struct.battery_remaining = buf.get_u8()?;
16155 __struct.temperature = buf.get_i8()?;
16156 __struct.temperature_air = buf.get_i8()?;
16157 __struct.failsafe = buf.get_u8()?;
16158 __struct.wp_num = buf.get_u8()?;
16159 Ok(__struct)
16160 }
16161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16162 let mut __tmp = BytesMut::new(bytes);
16163 #[allow(clippy::absurd_extreme_comparisons)]
16164 #[allow(unused_comparisons)]
16165 if __tmp.remaining() < Self::ENCODED_LEN {
16166 panic!(
16167 "buffer is too small (need {} bytes, but got {})",
16168 Self::ENCODED_LEN,
16169 __tmp.remaining(),
16170 )
16171 }
16172 __tmp.put_u32_le(self.custom_mode);
16173 __tmp.put_i32_le(self.latitude);
16174 __tmp.put_i32_le(self.longitude);
16175 __tmp.put_i16_le(self.roll);
16176 __tmp.put_i16_le(self.pitch);
16177 __tmp.put_u16_le(self.heading);
16178 __tmp.put_i16_le(self.heading_sp);
16179 __tmp.put_i16_le(self.altitude_amsl);
16180 __tmp.put_i16_le(self.altitude_sp);
16181 __tmp.put_u16_le(self.wp_distance);
16182 __tmp.put_u8(self.base_mode.bits() as u8);
16183 __tmp.put_u8(self.landed_state as u8);
16184 __tmp.put_i8(self.throttle);
16185 __tmp.put_u8(self.airspeed);
16186 __tmp.put_u8(self.airspeed_sp);
16187 __tmp.put_u8(self.groundspeed);
16188 __tmp.put_i8(self.climb_rate);
16189 __tmp.put_u8(self.gps_nsat);
16190 __tmp.put_u8(self.gps_fix_type as u8);
16191 __tmp.put_u8(self.battery_remaining);
16192 __tmp.put_i8(self.temperature);
16193 __tmp.put_i8(self.temperature_air);
16194 __tmp.put_u8(self.failsafe);
16195 __tmp.put_u8(self.wp_num);
16196 if matches!(version, MavlinkVersion::V2) {
16197 let len = __tmp.len();
16198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16199 } else {
16200 __tmp.len()
16201 }
16202 }
16203}
16204#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
16205#[doc = ""]
16206#[doc = "ID: 235"]
16207#[derive(Debug, Clone, PartialEq)]
16208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16210#[cfg_attr(feature = "ts", derive(TS))]
16211#[cfg_attr(feature = "ts", ts(export))]
16212pub struct HIGH_LATENCY2_DATA {
16213 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
16214 pub timestamp: u32,
16215 #[doc = "Latitude"]
16216 pub latitude: i32,
16217 #[doc = "Longitude"]
16218 pub longitude: i32,
16219 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
16220 pub custom_mode: u16,
16221 #[doc = "Altitude above mean sea level"]
16222 pub altitude: i16,
16223 #[doc = "Altitude setpoint"]
16224 pub target_altitude: i16,
16225 #[doc = "Distance to target waypoint or position"]
16226 pub target_distance: u16,
16227 #[doc = "Current waypoint number"]
16228 pub wp_num: u16,
16229 #[doc = "Bitmap of failure flags."]
16230 pub failure_flags: HlFailureFlag,
16231 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
16232 pub mavtype: MavType,
16233 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16234 pub autopilot: MavAutopilot,
16235 #[doc = "Heading"]
16236 pub heading: u8,
16237 #[doc = "Heading setpoint"]
16238 pub target_heading: u8,
16239 #[doc = "Throttle"]
16240 pub throttle: u8,
16241 #[doc = "Airspeed"]
16242 pub airspeed: u8,
16243 #[doc = "Airspeed setpoint"]
16244 pub airspeed_sp: u8,
16245 #[doc = "Groundspeed"]
16246 pub groundspeed: u8,
16247 #[doc = "Windspeed"]
16248 pub windspeed: u8,
16249 #[doc = "Wind heading"]
16250 pub wind_heading: u8,
16251 #[doc = "Maximum error horizontal position since last message"]
16252 pub eph: u8,
16253 #[doc = "Maximum error vertical position since last message"]
16254 pub epv: u8,
16255 #[doc = "Air temperature"]
16256 pub temperature_air: i8,
16257 #[doc = "Maximum climb rate magnitude since last message"]
16258 pub climb_rate: i8,
16259 #[doc = "Battery level (-1 if field not provided)."]
16260 pub battery: i8,
16261 #[doc = "Field for custom payload."]
16262 pub custom0: i8,
16263 #[doc = "Field for custom payload."]
16264 pub custom1: i8,
16265 #[doc = "Field for custom payload."]
16266 pub custom2: i8,
16267}
16268impl HIGH_LATENCY2_DATA {
16269 pub const ENCODED_LEN: usize = 42usize;
16270 pub const DEFAULT: Self = Self {
16271 timestamp: 0_u32,
16272 latitude: 0_i32,
16273 longitude: 0_i32,
16274 custom_mode: 0_u16,
16275 altitude: 0_i16,
16276 target_altitude: 0_i16,
16277 target_distance: 0_u16,
16278 wp_num: 0_u16,
16279 failure_flags: HlFailureFlag::DEFAULT,
16280 mavtype: MavType::DEFAULT,
16281 autopilot: MavAutopilot::DEFAULT,
16282 heading: 0_u8,
16283 target_heading: 0_u8,
16284 throttle: 0_u8,
16285 airspeed: 0_u8,
16286 airspeed_sp: 0_u8,
16287 groundspeed: 0_u8,
16288 windspeed: 0_u8,
16289 wind_heading: 0_u8,
16290 eph: 0_u8,
16291 epv: 0_u8,
16292 temperature_air: 0_i8,
16293 climb_rate: 0_i8,
16294 battery: 0_i8,
16295 custom0: 0_i8,
16296 custom1: 0_i8,
16297 custom2: 0_i8,
16298 };
16299 #[cfg(feature = "arbitrary")]
16300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16301 use arbitrary::{Arbitrary, Unstructured};
16302 let mut buf = [0u8; 1024];
16303 rng.fill_bytes(&mut buf);
16304 let mut unstructured = Unstructured::new(&buf);
16305 Self::arbitrary(&mut unstructured).unwrap_or_default()
16306 }
16307}
16308impl Default for HIGH_LATENCY2_DATA {
16309 fn default() -> Self {
16310 Self::DEFAULT.clone()
16311 }
16312}
16313impl MessageData for HIGH_LATENCY2_DATA {
16314 type Message = MavMessage;
16315 const ID: u32 = 235u32;
16316 const NAME: &'static str = "HIGH_LATENCY2";
16317 const EXTRA_CRC: u8 = 179u8;
16318 const ENCODED_LEN: usize = 42usize;
16319 fn deser(
16320 _version: MavlinkVersion,
16321 __input: &[u8],
16322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16323 let avail_len = __input.len();
16324 let mut payload_buf = [0; Self::ENCODED_LEN];
16325 let mut buf = if avail_len < Self::ENCODED_LEN {
16326 payload_buf[0..avail_len].copy_from_slice(__input);
16327 Bytes::new(&payload_buf)
16328 } else {
16329 Bytes::new(__input)
16330 };
16331 let mut __struct = Self::default();
16332 __struct.timestamp = buf.get_u32_le()?;
16333 __struct.latitude = buf.get_i32_le()?;
16334 __struct.longitude = buf.get_i32_le()?;
16335 __struct.custom_mode = buf.get_u16_le()?;
16336 __struct.altitude = buf.get_i16_le()?;
16337 __struct.target_altitude = buf.get_i16_le()?;
16338 __struct.target_distance = buf.get_u16_le()?;
16339 __struct.wp_num = buf.get_u16_le()?;
16340 let tmp = buf.get_u16_le()?;
16341 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
16342 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16343 flag_type: "HlFailureFlag",
16344 value: tmp as u64,
16345 })?;
16346 let tmp = buf.get_u8()?;
16347 __struct.mavtype =
16348 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16349 enum_type: "MavType",
16350 value: tmp as u64,
16351 })?;
16352 let tmp = buf.get_u8()?;
16353 __struct.autopilot =
16354 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16355 enum_type: "MavAutopilot",
16356 value: tmp as u64,
16357 })?;
16358 __struct.heading = buf.get_u8()?;
16359 __struct.target_heading = buf.get_u8()?;
16360 __struct.throttle = buf.get_u8()?;
16361 __struct.airspeed = buf.get_u8()?;
16362 __struct.airspeed_sp = buf.get_u8()?;
16363 __struct.groundspeed = buf.get_u8()?;
16364 __struct.windspeed = buf.get_u8()?;
16365 __struct.wind_heading = buf.get_u8()?;
16366 __struct.eph = buf.get_u8()?;
16367 __struct.epv = buf.get_u8()?;
16368 __struct.temperature_air = buf.get_i8()?;
16369 __struct.climb_rate = buf.get_i8()?;
16370 __struct.battery = buf.get_i8()?;
16371 __struct.custom0 = buf.get_i8()?;
16372 __struct.custom1 = buf.get_i8()?;
16373 __struct.custom2 = buf.get_i8()?;
16374 Ok(__struct)
16375 }
16376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16377 let mut __tmp = BytesMut::new(bytes);
16378 #[allow(clippy::absurd_extreme_comparisons)]
16379 #[allow(unused_comparisons)]
16380 if __tmp.remaining() < Self::ENCODED_LEN {
16381 panic!(
16382 "buffer is too small (need {} bytes, but got {})",
16383 Self::ENCODED_LEN,
16384 __tmp.remaining(),
16385 )
16386 }
16387 __tmp.put_u32_le(self.timestamp);
16388 __tmp.put_i32_le(self.latitude);
16389 __tmp.put_i32_le(self.longitude);
16390 __tmp.put_u16_le(self.custom_mode);
16391 __tmp.put_i16_le(self.altitude);
16392 __tmp.put_i16_le(self.target_altitude);
16393 __tmp.put_u16_le(self.target_distance);
16394 __tmp.put_u16_le(self.wp_num);
16395 __tmp.put_u16_le(self.failure_flags.bits() as u16);
16396 __tmp.put_u8(self.mavtype as u8);
16397 __tmp.put_u8(self.autopilot as u8);
16398 __tmp.put_u8(self.heading);
16399 __tmp.put_u8(self.target_heading);
16400 __tmp.put_u8(self.throttle);
16401 __tmp.put_u8(self.airspeed);
16402 __tmp.put_u8(self.airspeed_sp);
16403 __tmp.put_u8(self.groundspeed);
16404 __tmp.put_u8(self.windspeed);
16405 __tmp.put_u8(self.wind_heading);
16406 __tmp.put_u8(self.eph);
16407 __tmp.put_u8(self.epv);
16408 __tmp.put_i8(self.temperature_air);
16409 __tmp.put_i8(self.climb_rate);
16410 __tmp.put_i8(self.battery);
16411 __tmp.put_i8(self.custom0);
16412 __tmp.put_i8(self.custom1);
16413 __tmp.put_i8(self.custom2);
16414 if matches!(version, MavlinkVersion::V2) {
16415 let len = __tmp.len();
16416 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16417 } else {
16418 __tmp.len()
16419 }
16420 }
16421}
16422#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16423#[doc = ""]
16424#[doc = "ID: 93"]
16425#[derive(Debug, Clone, PartialEq)]
16426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16428#[cfg_attr(feature = "ts", derive(TS))]
16429#[cfg_attr(feature = "ts", ts(export))]
16430pub struct HIL_ACTUATOR_CONTROLS_DATA {
16431 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16432 pub time_usec: u64,
16433 #[doc = "Flags bitmask."]
16434 pub flags: HilActuatorControlsFlags,
16435 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16437 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16438 pub controls: [f32; 16],
16439 #[doc = "System mode. Includes arming state."]
16440 pub mode: MavModeFlag,
16441}
16442impl HIL_ACTUATOR_CONTROLS_DATA {
16443 pub const ENCODED_LEN: usize = 81usize;
16444 pub const DEFAULT: Self = Self {
16445 time_usec: 0_u64,
16446 flags: HilActuatorControlsFlags::DEFAULT,
16447 controls: [0.0_f32; 16usize],
16448 mode: MavModeFlag::DEFAULT,
16449 };
16450 #[cfg(feature = "arbitrary")]
16451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16452 use arbitrary::{Arbitrary, Unstructured};
16453 let mut buf = [0u8; 1024];
16454 rng.fill_bytes(&mut buf);
16455 let mut unstructured = Unstructured::new(&buf);
16456 Self::arbitrary(&mut unstructured).unwrap_or_default()
16457 }
16458}
16459impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16460 fn default() -> Self {
16461 Self::DEFAULT.clone()
16462 }
16463}
16464impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16465 type Message = MavMessage;
16466 const ID: u32 = 93u32;
16467 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16468 const EXTRA_CRC: u8 = 47u8;
16469 const ENCODED_LEN: usize = 81usize;
16470 fn deser(
16471 _version: MavlinkVersion,
16472 __input: &[u8],
16473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16474 let avail_len = __input.len();
16475 let mut payload_buf = [0; Self::ENCODED_LEN];
16476 let mut buf = if avail_len < Self::ENCODED_LEN {
16477 payload_buf[0..avail_len].copy_from_slice(__input);
16478 Bytes::new(&payload_buf)
16479 } else {
16480 Bytes::new(__input)
16481 };
16482 let mut __struct = Self::default();
16483 __struct.time_usec = buf.get_u64_le()?;
16484 let tmp = buf.get_u64_le()?;
16485 __struct.flags =
16486 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
16487 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16488 flag_type: "HilActuatorControlsFlags",
16489 value: tmp as u64,
16490 })?;
16491 for v in &mut __struct.controls {
16492 let val = buf.get_f32_le()?;
16493 *v = val;
16494 }
16495 let tmp = buf.get_u8()?;
16496 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16497 ::mavlink_core::error::ParserError::InvalidFlag {
16498 flag_type: "MavModeFlag",
16499 value: tmp as u64,
16500 },
16501 )?;
16502 Ok(__struct)
16503 }
16504 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16505 let mut __tmp = BytesMut::new(bytes);
16506 #[allow(clippy::absurd_extreme_comparisons)]
16507 #[allow(unused_comparisons)]
16508 if __tmp.remaining() < Self::ENCODED_LEN {
16509 panic!(
16510 "buffer is too small (need {} bytes, but got {})",
16511 Self::ENCODED_LEN,
16512 __tmp.remaining(),
16513 )
16514 }
16515 __tmp.put_u64_le(self.time_usec);
16516 __tmp.put_u64_le(self.flags.bits() as u64);
16517 for val in &self.controls {
16518 __tmp.put_f32_le(*val);
16519 }
16520 __tmp.put_u8(self.mode.bits() as u8);
16521 if matches!(version, MavlinkVersion::V2) {
16522 let len = __tmp.len();
16523 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16524 } else {
16525 __tmp.len()
16526 }
16527 }
16528}
16529#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16530#[doc = ""]
16531#[doc = "ID: 91"]
16532#[derive(Debug, Clone, PartialEq)]
16533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16535#[cfg_attr(feature = "ts", derive(TS))]
16536#[cfg_attr(feature = "ts", ts(export))]
16537pub struct HIL_CONTROLS_DATA {
16538 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16539 pub time_usec: u64,
16540 #[doc = "Control output -1 .. 1"]
16541 pub roll_ailerons: f32,
16542 #[doc = "Control output -1 .. 1"]
16543 pub pitch_elevator: f32,
16544 #[doc = "Control output -1 .. 1"]
16545 pub yaw_rudder: f32,
16546 #[doc = "Throttle 0 .. 1"]
16547 pub throttle: f32,
16548 #[doc = "Aux 1, -1 .. 1"]
16549 pub aux1: f32,
16550 #[doc = "Aux 2, -1 .. 1"]
16551 pub aux2: f32,
16552 #[doc = "Aux 3, -1 .. 1"]
16553 pub aux3: f32,
16554 #[doc = "Aux 4, -1 .. 1"]
16555 pub aux4: f32,
16556 #[doc = "System mode."]
16557 pub mode: MavMode,
16558 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16559 pub nav_mode: u8,
16560}
16561impl HIL_CONTROLS_DATA {
16562 pub const ENCODED_LEN: usize = 42usize;
16563 pub const DEFAULT: Self = Self {
16564 time_usec: 0_u64,
16565 roll_ailerons: 0.0_f32,
16566 pitch_elevator: 0.0_f32,
16567 yaw_rudder: 0.0_f32,
16568 throttle: 0.0_f32,
16569 aux1: 0.0_f32,
16570 aux2: 0.0_f32,
16571 aux3: 0.0_f32,
16572 aux4: 0.0_f32,
16573 mode: MavMode::DEFAULT,
16574 nav_mode: 0_u8,
16575 };
16576 #[cfg(feature = "arbitrary")]
16577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16578 use arbitrary::{Arbitrary, Unstructured};
16579 let mut buf = [0u8; 1024];
16580 rng.fill_bytes(&mut buf);
16581 let mut unstructured = Unstructured::new(&buf);
16582 Self::arbitrary(&mut unstructured).unwrap_or_default()
16583 }
16584}
16585impl Default for HIL_CONTROLS_DATA {
16586 fn default() -> Self {
16587 Self::DEFAULT.clone()
16588 }
16589}
16590impl MessageData for HIL_CONTROLS_DATA {
16591 type Message = MavMessage;
16592 const ID: u32 = 91u32;
16593 const NAME: &'static str = "HIL_CONTROLS";
16594 const EXTRA_CRC: u8 = 63u8;
16595 const ENCODED_LEN: usize = 42usize;
16596 fn deser(
16597 _version: MavlinkVersion,
16598 __input: &[u8],
16599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16600 let avail_len = __input.len();
16601 let mut payload_buf = [0; Self::ENCODED_LEN];
16602 let mut buf = if avail_len < Self::ENCODED_LEN {
16603 payload_buf[0..avail_len].copy_from_slice(__input);
16604 Bytes::new(&payload_buf)
16605 } else {
16606 Bytes::new(__input)
16607 };
16608 let mut __struct = Self::default();
16609 __struct.time_usec = buf.get_u64_le()?;
16610 __struct.roll_ailerons = buf.get_f32_le()?;
16611 __struct.pitch_elevator = buf.get_f32_le()?;
16612 __struct.yaw_rudder = buf.get_f32_le()?;
16613 __struct.throttle = buf.get_f32_le()?;
16614 __struct.aux1 = buf.get_f32_le()?;
16615 __struct.aux2 = buf.get_f32_le()?;
16616 __struct.aux3 = buf.get_f32_le()?;
16617 __struct.aux4 = buf.get_f32_le()?;
16618 let tmp = buf.get_u8()?;
16619 __struct.mode =
16620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16621 enum_type: "MavMode",
16622 value: tmp as u64,
16623 })?;
16624 __struct.nav_mode = buf.get_u8()?;
16625 Ok(__struct)
16626 }
16627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16628 let mut __tmp = BytesMut::new(bytes);
16629 #[allow(clippy::absurd_extreme_comparisons)]
16630 #[allow(unused_comparisons)]
16631 if __tmp.remaining() < Self::ENCODED_LEN {
16632 panic!(
16633 "buffer is too small (need {} bytes, but got {})",
16634 Self::ENCODED_LEN,
16635 __tmp.remaining(),
16636 )
16637 }
16638 __tmp.put_u64_le(self.time_usec);
16639 __tmp.put_f32_le(self.roll_ailerons);
16640 __tmp.put_f32_le(self.pitch_elevator);
16641 __tmp.put_f32_le(self.yaw_rudder);
16642 __tmp.put_f32_le(self.throttle);
16643 __tmp.put_f32_le(self.aux1);
16644 __tmp.put_f32_le(self.aux2);
16645 __tmp.put_f32_le(self.aux3);
16646 __tmp.put_f32_le(self.aux4);
16647 __tmp.put_u8(self.mode as u8);
16648 __tmp.put_u8(self.nav_mode);
16649 if matches!(version, MavlinkVersion::V2) {
16650 let len = __tmp.len();
16651 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16652 } else {
16653 __tmp.len()
16654 }
16655 }
16656}
16657#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16658#[doc = ""]
16659#[doc = "ID: 113"]
16660#[derive(Debug, Clone, PartialEq)]
16661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16663#[cfg_attr(feature = "ts", derive(TS))]
16664#[cfg_attr(feature = "ts", ts(export))]
16665pub struct HIL_GPS_DATA {
16666 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16667 pub time_usec: u64,
16668 #[doc = "Latitude (WGS84)"]
16669 pub lat: i32,
16670 #[doc = "Longitude (WGS84)"]
16671 pub lon: i32,
16672 #[doc = "Altitude (MSL). Positive for up."]
16673 pub alt: i32,
16674 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16675 pub eph: u16,
16676 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16677 pub epv: u16,
16678 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16679 pub vel: u16,
16680 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16681 pub vn: i16,
16682 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16683 pub ve: i16,
16684 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16685 pub vd: i16,
16686 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16687 pub cog: u16,
16688 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16689 pub fix_type: u8,
16690 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16691 pub satellites_visible: u8,
16692 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16694 pub id: u8,
16695 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16696 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16697 pub yaw: u16,
16698}
16699impl HIL_GPS_DATA {
16700 pub const ENCODED_LEN: usize = 39usize;
16701 pub const DEFAULT: Self = Self {
16702 time_usec: 0_u64,
16703 lat: 0_i32,
16704 lon: 0_i32,
16705 alt: 0_i32,
16706 eph: 0_u16,
16707 epv: 0_u16,
16708 vel: 0_u16,
16709 vn: 0_i16,
16710 ve: 0_i16,
16711 vd: 0_i16,
16712 cog: 0_u16,
16713 fix_type: 0_u8,
16714 satellites_visible: 0_u8,
16715 id: 0_u8,
16716 yaw: 0_u16,
16717 };
16718 #[cfg(feature = "arbitrary")]
16719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16720 use arbitrary::{Arbitrary, Unstructured};
16721 let mut buf = [0u8; 1024];
16722 rng.fill_bytes(&mut buf);
16723 let mut unstructured = Unstructured::new(&buf);
16724 Self::arbitrary(&mut unstructured).unwrap_or_default()
16725 }
16726}
16727impl Default for HIL_GPS_DATA {
16728 fn default() -> Self {
16729 Self::DEFAULT.clone()
16730 }
16731}
16732impl MessageData for HIL_GPS_DATA {
16733 type Message = MavMessage;
16734 const ID: u32 = 113u32;
16735 const NAME: &'static str = "HIL_GPS";
16736 const EXTRA_CRC: u8 = 124u8;
16737 const ENCODED_LEN: usize = 39usize;
16738 fn deser(
16739 _version: MavlinkVersion,
16740 __input: &[u8],
16741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16742 let avail_len = __input.len();
16743 let mut payload_buf = [0; Self::ENCODED_LEN];
16744 let mut buf = if avail_len < Self::ENCODED_LEN {
16745 payload_buf[0..avail_len].copy_from_slice(__input);
16746 Bytes::new(&payload_buf)
16747 } else {
16748 Bytes::new(__input)
16749 };
16750 let mut __struct = Self::default();
16751 __struct.time_usec = buf.get_u64_le()?;
16752 __struct.lat = buf.get_i32_le()?;
16753 __struct.lon = buf.get_i32_le()?;
16754 __struct.alt = buf.get_i32_le()?;
16755 __struct.eph = buf.get_u16_le()?;
16756 __struct.epv = buf.get_u16_le()?;
16757 __struct.vel = buf.get_u16_le()?;
16758 __struct.vn = buf.get_i16_le()?;
16759 __struct.ve = buf.get_i16_le()?;
16760 __struct.vd = buf.get_i16_le()?;
16761 __struct.cog = buf.get_u16_le()?;
16762 __struct.fix_type = buf.get_u8()?;
16763 __struct.satellites_visible = buf.get_u8()?;
16764 __struct.id = buf.get_u8()?;
16765 __struct.yaw = buf.get_u16_le()?;
16766 Ok(__struct)
16767 }
16768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16769 let mut __tmp = BytesMut::new(bytes);
16770 #[allow(clippy::absurd_extreme_comparisons)]
16771 #[allow(unused_comparisons)]
16772 if __tmp.remaining() < Self::ENCODED_LEN {
16773 panic!(
16774 "buffer is too small (need {} bytes, but got {})",
16775 Self::ENCODED_LEN,
16776 __tmp.remaining(),
16777 )
16778 }
16779 __tmp.put_u64_le(self.time_usec);
16780 __tmp.put_i32_le(self.lat);
16781 __tmp.put_i32_le(self.lon);
16782 __tmp.put_i32_le(self.alt);
16783 __tmp.put_u16_le(self.eph);
16784 __tmp.put_u16_le(self.epv);
16785 __tmp.put_u16_le(self.vel);
16786 __tmp.put_i16_le(self.vn);
16787 __tmp.put_i16_le(self.ve);
16788 __tmp.put_i16_le(self.vd);
16789 __tmp.put_u16_le(self.cog);
16790 __tmp.put_u8(self.fix_type);
16791 __tmp.put_u8(self.satellites_visible);
16792 if matches!(version, MavlinkVersion::V2) {
16793 __tmp.put_u8(self.id);
16794 __tmp.put_u16_le(self.yaw);
16795 let len = __tmp.len();
16796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16797 } else {
16798 __tmp.len()
16799 }
16800 }
16801}
16802#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16803#[doc = ""]
16804#[doc = "ID: 114"]
16805#[derive(Debug, Clone, PartialEq)]
16806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16808#[cfg_attr(feature = "ts", derive(TS))]
16809#[cfg_attr(feature = "ts", ts(export))]
16810pub struct HIL_OPTICAL_FLOW_DATA {
16811 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16812 pub time_usec: u64,
16813 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16814 pub integration_time_us: u32,
16815 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16816 pub integrated_x: f32,
16817 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16818 pub integrated_y: f32,
16819 #[doc = "RH rotation around X axis"]
16820 pub integrated_xgyro: f32,
16821 #[doc = "RH rotation around Y axis"]
16822 pub integrated_ygyro: f32,
16823 #[doc = "RH rotation around Z axis"]
16824 pub integrated_zgyro: f32,
16825 #[doc = "Time since the distance was sampled."]
16826 pub time_delta_distance_us: u32,
16827 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16828 pub distance: f32,
16829 #[doc = "Temperature"]
16830 pub temperature: i16,
16831 #[doc = "Sensor ID"]
16832 pub sensor_id: u8,
16833 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16834 pub quality: u8,
16835}
16836impl HIL_OPTICAL_FLOW_DATA {
16837 pub const ENCODED_LEN: usize = 44usize;
16838 pub const DEFAULT: Self = Self {
16839 time_usec: 0_u64,
16840 integration_time_us: 0_u32,
16841 integrated_x: 0.0_f32,
16842 integrated_y: 0.0_f32,
16843 integrated_xgyro: 0.0_f32,
16844 integrated_ygyro: 0.0_f32,
16845 integrated_zgyro: 0.0_f32,
16846 time_delta_distance_us: 0_u32,
16847 distance: 0.0_f32,
16848 temperature: 0_i16,
16849 sensor_id: 0_u8,
16850 quality: 0_u8,
16851 };
16852 #[cfg(feature = "arbitrary")]
16853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16854 use arbitrary::{Arbitrary, Unstructured};
16855 let mut buf = [0u8; 1024];
16856 rng.fill_bytes(&mut buf);
16857 let mut unstructured = Unstructured::new(&buf);
16858 Self::arbitrary(&mut unstructured).unwrap_or_default()
16859 }
16860}
16861impl Default for HIL_OPTICAL_FLOW_DATA {
16862 fn default() -> Self {
16863 Self::DEFAULT.clone()
16864 }
16865}
16866impl MessageData for HIL_OPTICAL_FLOW_DATA {
16867 type Message = MavMessage;
16868 const ID: u32 = 114u32;
16869 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16870 const EXTRA_CRC: u8 = 237u8;
16871 const ENCODED_LEN: usize = 44usize;
16872 fn deser(
16873 _version: MavlinkVersion,
16874 __input: &[u8],
16875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16876 let avail_len = __input.len();
16877 let mut payload_buf = [0; Self::ENCODED_LEN];
16878 let mut buf = if avail_len < Self::ENCODED_LEN {
16879 payload_buf[0..avail_len].copy_from_slice(__input);
16880 Bytes::new(&payload_buf)
16881 } else {
16882 Bytes::new(__input)
16883 };
16884 let mut __struct = Self::default();
16885 __struct.time_usec = buf.get_u64_le()?;
16886 __struct.integration_time_us = buf.get_u32_le()?;
16887 __struct.integrated_x = buf.get_f32_le()?;
16888 __struct.integrated_y = buf.get_f32_le()?;
16889 __struct.integrated_xgyro = buf.get_f32_le()?;
16890 __struct.integrated_ygyro = buf.get_f32_le()?;
16891 __struct.integrated_zgyro = buf.get_f32_le()?;
16892 __struct.time_delta_distance_us = buf.get_u32_le()?;
16893 __struct.distance = buf.get_f32_le()?;
16894 __struct.temperature = buf.get_i16_le()?;
16895 __struct.sensor_id = buf.get_u8()?;
16896 __struct.quality = buf.get_u8()?;
16897 Ok(__struct)
16898 }
16899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16900 let mut __tmp = BytesMut::new(bytes);
16901 #[allow(clippy::absurd_extreme_comparisons)]
16902 #[allow(unused_comparisons)]
16903 if __tmp.remaining() < Self::ENCODED_LEN {
16904 panic!(
16905 "buffer is too small (need {} bytes, but got {})",
16906 Self::ENCODED_LEN,
16907 __tmp.remaining(),
16908 )
16909 }
16910 __tmp.put_u64_le(self.time_usec);
16911 __tmp.put_u32_le(self.integration_time_us);
16912 __tmp.put_f32_le(self.integrated_x);
16913 __tmp.put_f32_le(self.integrated_y);
16914 __tmp.put_f32_le(self.integrated_xgyro);
16915 __tmp.put_f32_le(self.integrated_ygyro);
16916 __tmp.put_f32_le(self.integrated_zgyro);
16917 __tmp.put_u32_le(self.time_delta_distance_us);
16918 __tmp.put_f32_le(self.distance);
16919 __tmp.put_i16_le(self.temperature);
16920 __tmp.put_u8(self.sensor_id);
16921 __tmp.put_u8(self.quality);
16922 if matches!(version, MavlinkVersion::V2) {
16923 let len = __tmp.len();
16924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16925 } else {
16926 __tmp.len()
16927 }
16928 }
16929}
16930#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16931#[doc = ""]
16932#[doc = "ID: 92"]
16933#[derive(Debug, Clone, PartialEq)]
16934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16936#[cfg_attr(feature = "ts", derive(TS))]
16937#[cfg_attr(feature = "ts", ts(export))]
16938pub struct HIL_RC_INPUTS_RAW_DATA {
16939 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16940 pub time_usec: u64,
16941 #[doc = "RC channel 1 value"]
16942 pub chan1_raw: u16,
16943 #[doc = "RC channel 2 value"]
16944 pub chan2_raw: u16,
16945 #[doc = "RC channel 3 value"]
16946 pub chan3_raw: u16,
16947 #[doc = "RC channel 4 value"]
16948 pub chan4_raw: u16,
16949 #[doc = "RC channel 5 value"]
16950 pub chan5_raw: u16,
16951 #[doc = "RC channel 6 value"]
16952 pub chan6_raw: u16,
16953 #[doc = "RC channel 7 value"]
16954 pub chan7_raw: u16,
16955 #[doc = "RC channel 8 value"]
16956 pub chan8_raw: u16,
16957 #[doc = "RC channel 9 value"]
16958 pub chan9_raw: u16,
16959 #[doc = "RC channel 10 value"]
16960 pub chan10_raw: u16,
16961 #[doc = "RC channel 11 value"]
16962 pub chan11_raw: u16,
16963 #[doc = "RC channel 12 value"]
16964 pub chan12_raw: u16,
16965 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16966 pub rssi: u8,
16967}
16968impl HIL_RC_INPUTS_RAW_DATA {
16969 pub const ENCODED_LEN: usize = 33usize;
16970 pub const DEFAULT: Self = Self {
16971 time_usec: 0_u64,
16972 chan1_raw: 0_u16,
16973 chan2_raw: 0_u16,
16974 chan3_raw: 0_u16,
16975 chan4_raw: 0_u16,
16976 chan5_raw: 0_u16,
16977 chan6_raw: 0_u16,
16978 chan7_raw: 0_u16,
16979 chan8_raw: 0_u16,
16980 chan9_raw: 0_u16,
16981 chan10_raw: 0_u16,
16982 chan11_raw: 0_u16,
16983 chan12_raw: 0_u16,
16984 rssi: 0_u8,
16985 };
16986 #[cfg(feature = "arbitrary")]
16987 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16988 use arbitrary::{Arbitrary, Unstructured};
16989 let mut buf = [0u8; 1024];
16990 rng.fill_bytes(&mut buf);
16991 let mut unstructured = Unstructured::new(&buf);
16992 Self::arbitrary(&mut unstructured).unwrap_or_default()
16993 }
16994}
16995impl Default for HIL_RC_INPUTS_RAW_DATA {
16996 fn default() -> Self {
16997 Self::DEFAULT.clone()
16998 }
16999}
17000impl MessageData for HIL_RC_INPUTS_RAW_DATA {
17001 type Message = MavMessage;
17002 const ID: u32 = 92u32;
17003 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
17004 const EXTRA_CRC: u8 = 54u8;
17005 const ENCODED_LEN: usize = 33usize;
17006 fn deser(
17007 _version: MavlinkVersion,
17008 __input: &[u8],
17009 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17010 let avail_len = __input.len();
17011 let mut payload_buf = [0; Self::ENCODED_LEN];
17012 let mut buf = if avail_len < Self::ENCODED_LEN {
17013 payload_buf[0..avail_len].copy_from_slice(__input);
17014 Bytes::new(&payload_buf)
17015 } else {
17016 Bytes::new(__input)
17017 };
17018 let mut __struct = Self::default();
17019 __struct.time_usec = buf.get_u64_le()?;
17020 __struct.chan1_raw = buf.get_u16_le()?;
17021 __struct.chan2_raw = buf.get_u16_le()?;
17022 __struct.chan3_raw = buf.get_u16_le()?;
17023 __struct.chan4_raw = buf.get_u16_le()?;
17024 __struct.chan5_raw = buf.get_u16_le()?;
17025 __struct.chan6_raw = buf.get_u16_le()?;
17026 __struct.chan7_raw = buf.get_u16_le()?;
17027 __struct.chan8_raw = buf.get_u16_le()?;
17028 __struct.chan9_raw = buf.get_u16_le()?;
17029 __struct.chan10_raw = buf.get_u16_le()?;
17030 __struct.chan11_raw = buf.get_u16_le()?;
17031 __struct.chan12_raw = buf.get_u16_le()?;
17032 __struct.rssi = buf.get_u8()?;
17033 Ok(__struct)
17034 }
17035 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17036 let mut __tmp = BytesMut::new(bytes);
17037 #[allow(clippy::absurd_extreme_comparisons)]
17038 #[allow(unused_comparisons)]
17039 if __tmp.remaining() < Self::ENCODED_LEN {
17040 panic!(
17041 "buffer is too small (need {} bytes, but got {})",
17042 Self::ENCODED_LEN,
17043 __tmp.remaining(),
17044 )
17045 }
17046 __tmp.put_u64_le(self.time_usec);
17047 __tmp.put_u16_le(self.chan1_raw);
17048 __tmp.put_u16_le(self.chan2_raw);
17049 __tmp.put_u16_le(self.chan3_raw);
17050 __tmp.put_u16_le(self.chan4_raw);
17051 __tmp.put_u16_le(self.chan5_raw);
17052 __tmp.put_u16_le(self.chan6_raw);
17053 __tmp.put_u16_le(self.chan7_raw);
17054 __tmp.put_u16_le(self.chan8_raw);
17055 __tmp.put_u16_le(self.chan9_raw);
17056 __tmp.put_u16_le(self.chan10_raw);
17057 __tmp.put_u16_le(self.chan11_raw);
17058 __tmp.put_u16_le(self.chan12_raw);
17059 __tmp.put_u8(self.rssi);
17060 if matches!(version, MavlinkVersion::V2) {
17061 let len = __tmp.len();
17062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17063 } else {
17064 __tmp.len()
17065 }
17066 }
17067}
17068#[doc = "The IMU readings in SI units in NED body frame."]
17069#[doc = ""]
17070#[doc = "ID: 107"]
17071#[derive(Debug, Clone, PartialEq)]
17072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17074#[cfg_attr(feature = "ts", derive(TS))]
17075#[cfg_attr(feature = "ts", ts(export))]
17076pub struct HIL_SENSOR_DATA {
17077 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17078 pub time_usec: u64,
17079 #[doc = "X acceleration"]
17080 pub xacc: f32,
17081 #[doc = "Y acceleration"]
17082 pub yacc: f32,
17083 #[doc = "Z acceleration"]
17084 pub zacc: f32,
17085 #[doc = "Angular speed around X axis in body frame"]
17086 pub xgyro: f32,
17087 #[doc = "Angular speed around Y axis in body frame"]
17088 pub ygyro: f32,
17089 #[doc = "Angular speed around Z axis in body frame"]
17090 pub zgyro: f32,
17091 #[doc = "X Magnetic field"]
17092 pub xmag: f32,
17093 #[doc = "Y Magnetic field"]
17094 pub ymag: f32,
17095 #[doc = "Z Magnetic field"]
17096 pub zmag: f32,
17097 #[doc = "Absolute pressure"]
17098 pub abs_pressure: f32,
17099 #[doc = "Differential pressure (airspeed)"]
17100 pub diff_pressure: f32,
17101 #[doc = "Altitude calculated from pressure"]
17102 pub pressure_alt: f32,
17103 #[doc = "Temperature"]
17104 pub temperature: f32,
17105 #[doc = "Bitmap for fields that have updated since last message"]
17106 pub fields_updated: HilSensorUpdatedFlags,
17107 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17109 pub id: u8,
17110}
17111impl HIL_SENSOR_DATA {
17112 pub const ENCODED_LEN: usize = 65usize;
17113 pub const DEFAULT: Self = Self {
17114 time_usec: 0_u64,
17115 xacc: 0.0_f32,
17116 yacc: 0.0_f32,
17117 zacc: 0.0_f32,
17118 xgyro: 0.0_f32,
17119 ygyro: 0.0_f32,
17120 zgyro: 0.0_f32,
17121 xmag: 0.0_f32,
17122 ymag: 0.0_f32,
17123 zmag: 0.0_f32,
17124 abs_pressure: 0.0_f32,
17125 diff_pressure: 0.0_f32,
17126 pressure_alt: 0.0_f32,
17127 temperature: 0.0_f32,
17128 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17129 id: 0_u8,
17130 };
17131 #[cfg(feature = "arbitrary")]
17132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17133 use arbitrary::{Arbitrary, Unstructured};
17134 let mut buf = [0u8; 1024];
17135 rng.fill_bytes(&mut buf);
17136 let mut unstructured = Unstructured::new(&buf);
17137 Self::arbitrary(&mut unstructured).unwrap_or_default()
17138 }
17139}
17140impl Default for HIL_SENSOR_DATA {
17141 fn default() -> Self {
17142 Self::DEFAULT.clone()
17143 }
17144}
17145impl MessageData for HIL_SENSOR_DATA {
17146 type Message = MavMessage;
17147 const ID: u32 = 107u32;
17148 const NAME: &'static str = "HIL_SENSOR";
17149 const EXTRA_CRC: u8 = 108u8;
17150 const ENCODED_LEN: usize = 65usize;
17151 fn deser(
17152 _version: MavlinkVersion,
17153 __input: &[u8],
17154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17155 let avail_len = __input.len();
17156 let mut payload_buf = [0; Self::ENCODED_LEN];
17157 let mut buf = if avail_len < Self::ENCODED_LEN {
17158 payload_buf[0..avail_len].copy_from_slice(__input);
17159 Bytes::new(&payload_buf)
17160 } else {
17161 Bytes::new(__input)
17162 };
17163 let mut __struct = Self::default();
17164 __struct.time_usec = buf.get_u64_le()?;
17165 __struct.xacc = buf.get_f32_le()?;
17166 __struct.yacc = buf.get_f32_le()?;
17167 __struct.zacc = buf.get_f32_le()?;
17168 __struct.xgyro = buf.get_f32_le()?;
17169 __struct.ygyro = buf.get_f32_le()?;
17170 __struct.zgyro = buf.get_f32_le()?;
17171 __struct.xmag = buf.get_f32_le()?;
17172 __struct.ymag = buf.get_f32_le()?;
17173 __struct.zmag = buf.get_f32_le()?;
17174 __struct.abs_pressure = buf.get_f32_le()?;
17175 __struct.diff_pressure = buf.get_f32_le()?;
17176 __struct.pressure_alt = buf.get_f32_le()?;
17177 __struct.temperature = buf.get_f32_le()?;
17178 let tmp = buf.get_u32_le()?;
17179 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
17180 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
17181 )
17182 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17183 flag_type: "HilSensorUpdatedFlags",
17184 value: tmp as u64,
17185 })?;
17186 __struct.id = buf.get_u8()?;
17187 Ok(__struct)
17188 }
17189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17190 let mut __tmp = BytesMut::new(bytes);
17191 #[allow(clippy::absurd_extreme_comparisons)]
17192 #[allow(unused_comparisons)]
17193 if __tmp.remaining() < Self::ENCODED_LEN {
17194 panic!(
17195 "buffer is too small (need {} bytes, but got {})",
17196 Self::ENCODED_LEN,
17197 __tmp.remaining(),
17198 )
17199 }
17200 __tmp.put_u64_le(self.time_usec);
17201 __tmp.put_f32_le(self.xacc);
17202 __tmp.put_f32_le(self.yacc);
17203 __tmp.put_f32_le(self.zacc);
17204 __tmp.put_f32_le(self.xgyro);
17205 __tmp.put_f32_le(self.ygyro);
17206 __tmp.put_f32_le(self.zgyro);
17207 __tmp.put_f32_le(self.xmag);
17208 __tmp.put_f32_le(self.ymag);
17209 __tmp.put_f32_le(self.zmag);
17210 __tmp.put_f32_le(self.abs_pressure);
17211 __tmp.put_f32_le(self.diff_pressure);
17212 __tmp.put_f32_le(self.pressure_alt);
17213 __tmp.put_f32_le(self.temperature);
17214 __tmp.put_u32_le(self.fields_updated.bits() as u32);
17215 if matches!(version, MavlinkVersion::V2) {
17216 __tmp.put_u8(self.id);
17217 let len = __tmp.len();
17218 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17219 } else {
17220 __tmp.len()
17221 }
17222 }
17223}
17224#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
17225#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17226#[doc = ""]
17227#[doc = "ID: 90"]
17228#[derive(Debug, Clone, PartialEq)]
17229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17231#[cfg_attr(feature = "ts", derive(TS))]
17232#[cfg_attr(feature = "ts", ts(export))]
17233pub struct HIL_STATE_DATA {
17234 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17235 pub time_usec: u64,
17236 #[doc = "Roll angle"]
17237 pub roll: f32,
17238 #[doc = "Pitch angle"]
17239 pub pitch: f32,
17240 #[doc = "Yaw angle"]
17241 pub yaw: f32,
17242 #[doc = "Body frame roll / phi angular speed"]
17243 pub rollspeed: f32,
17244 #[doc = "Body frame pitch / theta angular speed"]
17245 pub pitchspeed: f32,
17246 #[doc = "Body frame yaw / psi angular speed"]
17247 pub yawspeed: f32,
17248 #[doc = "Latitude"]
17249 pub lat: i32,
17250 #[doc = "Longitude"]
17251 pub lon: i32,
17252 #[doc = "Altitude"]
17253 pub alt: i32,
17254 #[doc = "Ground X Speed (Latitude)"]
17255 pub vx: i16,
17256 #[doc = "Ground Y Speed (Longitude)"]
17257 pub vy: i16,
17258 #[doc = "Ground Z Speed (Altitude)"]
17259 pub vz: i16,
17260 #[doc = "X acceleration"]
17261 pub xacc: i16,
17262 #[doc = "Y acceleration"]
17263 pub yacc: i16,
17264 #[doc = "Z acceleration"]
17265 pub zacc: i16,
17266}
17267impl HIL_STATE_DATA {
17268 pub const ENCODED_LEN: usize = 56usize;
17269 pub const DEFAULT: Self = Self {
17270 time_usec: 0_u64,
17271 roll: 0.0_f32,
17272 pitch: 0.0_f32,
17273 yaw: 0.0_f32,
17274 rollspeed: 0.0_f32,
17275 pitchspeed: 0.0_f32,
17276 yawspeed: 0.0_f32,
17277 lat: 0_i32,
17278 lon: 0_i32,
17279 alt: 0_i32,
17280 vx: 0_i16,
17281 vy: 0_i16,
17282 vz: 0_i16,
17283 xacc: 0_i16,
17284 yacc: 0_i16,
17285 zacc: 0_i16,
17286 };
17287 #[cfg(feature = "arbitrary")]
17288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17289 use arbitrary::{Arbitrary, Unstructured};
17290 let mut buf = [0u8; 1024];
17291 rng.fill_bytes(&mut buf);
17292 let mut unstructured = Unstructured::new(&buf);
17293 Self::arbitrary(&mut unstructured).unwrap_or_default()
17294 }
17295}
17296impl Default for HIL_STATE_DATA {
17297 fn default() -> Self {
17298 Self::DEFAULT.clone()
17299 }
17300}
17301impl MessageData for HIL_STATE_DATA {
17302 type Message = MavMessage;
17303 const ID: u32 = 90u32;
17304 const NAME: &'static str = "HIL_STATE";
17305 const EXTRA_CRC: u8 = 183u8;
17306 const ENCODED_LEN: usize = 56usize;
17307 fn deser(
17308 _version: MavlinkVersion,
17309 __input: &[u8],
17310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17311 let avail_len = __input.len();
17312 let mut payload_buf = [0; Self::ENCODED_LEN];
17313 let mut buf = if avail_len < Self::ENCODED_LEN {
17314 payload_buf[0..avail_len].copy_from_slice(__input);
17315 Bytes::new(&payload_buf)
17316 } else {
17317 Bytes::new(__input)
17318 };
17319 let mut __struct = Self::default();
17320 __struct.time_usec = buf.get_u64_le()?;
17321 __struct.roll = buf.get_f32_le()?;
17322 __struct.pitch = buf.get_f32_le()?;
17323 __struct.yaw = buf.get_f32_le()?;
17324 __struct.rollspeed = buf.get_f32_le()?;
17325 __struct.pitchspeed = buf.get_f32_le()?;
17326 __struct.yawspeed = buf.get_f32_le()?;
17327 __struct.lat = buf.get_i32_le()?;
17328 __struct.lon = buf.get_i32_le()?;
17329 __struct.alt = buf.get_i32_le()?;
17330 __struct.vx = buf.get_i16_le()?;
17331 __struct.vy = buf.get_i16_le()?;
17332 __struct.vz = buf.get_i16_le()?;
17333 __struct.xacc = buf.get_i16_le()?;
17334 __struct.yacc = buf.get_i16_le()?;
17335 __struct.zacc = buf.get_i16_le()?;
17336 Ok(__struct)
17337 }
17338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17339 let mut __tmp = BytesMut::new(bytes);
17340 #[allow(clippy::absurd_extreme_comparisons)]
17341 #[allow(unused_comparisons)]
17342 if __tmp.remaining() < Self::ENCODED_LEN {
17343 panic!(
17344 "buffer is too small (need {} bytes, but got {})",
17345 Self::ENCODED_LEN,
17346 __tmp.remaining(),
17347 )
17348 }
17349 __tmp.put_u64_le(self.time_usec);
17350 __tmp.put_f32_le(self.roll);
17351 __tmp.put_f32_le(self.pitch);
17352 __tmp.put_f32_le(self.yaw);
17353 __tmp.put_f32_le(self.rollspeed);
17354 __tmp.put_f32_le(self.pitchspeed);
17355 __tmp.put_f32_le(self.yawspeed);
17356 __tmp.put_i32_le(self.lat);
17357 __tmp.put_i32_le(self.lon);
17358 __tmp.put_i32_le(self.alt);
17359 __tmp.put_i16_le(self.vx);
17360 __tmp.put_i16_le(self.vy);
17361 __tmp.put_i16_le(self.vz);
17362 __tmp.put_i16_le(self.xacc);
17363 __tmp.put_i16_le(self.yacc);
17364 __tmp.put_i16_le(self.zacc);
17365 if matches!(version, MavlinkVersion::V2) {
17366 let len = __tmp.len();
17367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17368 } else {
17369 __tmp.len()
17370 }
17371 }
17372}
17373#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17374#[doc = ""]
17375#[doc = "ID: 115"]
17376#[derive(Debug, Clone, PartialEq)]
17377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17379#[cfg_attr(feature = "ts", derive(TS))]
17380#[cfg_attr(feature = "ts", ts(export))]
17381pub struct HIL_STATE_QUATERNION_DATA {
17382 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17383 pub time_usec: u64,
17384 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17386 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17387 pub attitude_quaternion: [f32; 4],
17388 #[doc = "Body frame roll / phi angular speed"]
17389 pub rollspeed: f32,
17390 #[doc = "Body frame pitch / theta angular speed"]
17391 pub pitchspeed: f32,
17392 #[doc = "Body frame yaw / psi angular speed"]
17393 pub yawspeed: f32,
17394 #[doc = "Latitude"]
17395 pub lat: i32,
17396 #[doc = "Longitude"]
17397 pub lon: i32,
17398 #[doc = "Altitude"]
17399 pub alt: i32,
17400 #[doc = "Ground X Speed (Latitude)"]
17401 pub vx: i16,
17402 #[doc = "Ground Y Speed (Longitude)"]
17403 pub vy: i16,
17404 #[doc = "Ground Z Speed (Altitude)"]
17405 pub vz: i16,
17406 #[doc = "Indicated airspeed"]
17407 pub ind_airspeed: u16,
17408 #[doc = "True airspeed"]
17409 pub true_airspeed: u16,
17410 #[doc = "X acceleration"]
17411 pub xacc: i16,
17412 #[doc = "Y acceleration"]
17413 pub yacc: i16,
17414 #[doc = "Z acceleration"]
17415 pub zacc: i16,
17416}
17417impl HIL_STATE_QUATERNION_DATA {
17418 pub const ENCODED_LEN: usize = 64usize;
17419 pub const DEFAULT: Self = Self {
17420 time_usec: 0_u64,
17421 attitude_quaternion: [0.0_f32; 4usize],
17422 rollspeed: 0.0_f32,
17423 pitchspeed: 0.0_f32,
17424 yawspeed: 0.0_f32,
17425 lat: 0_i32,
17426 lon: 0_i32,
17427 alt: 0_i32,
17428 vx: 0_i16,
17429 vy: 0_i16,
17430 vz: 0_i16,
17431 ind_airspeed: 0_u16,
17432 true_airspeed: 0_u16,
17433 xacc: 0_i16,
17434 yacc: 0_i16,
17435 zacc: 0_i16,
17436 };
17437 #[cfg(feature = "arbitrary")]
17438 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17439 use arbitrary::{Arbitrary, Unstructured};
17440 let mut buf = [0u8; 1024];
17441 rng.fill_bytes(&mut buf);
17442 let mut unstructured = Unstructured::new(&buf);
17443 Self::arbitrary(&mut unstructured).unwrap_or_default()
17444 }
17445}
17446impl Default for HIL_STATE_QUATERNION_DATA {
17447 fn default() -> Self {
17448 Self::DEFAULT.clone()
17449 }
17450}
17451impl MessageData for HIL_STATE_QUATERNION_DATA {
17452 type Message = MavMessage;
17453 const ID: u32 = 115u32;
17454 const NAME: &'static str = "HIL_STATE_QUATERNION";
17455 const EXTRA_CRC: u8 = 4u8;
17456 const ENCODED_LEN: usize = 64usize;
17457 fn deser(
17458 _version: MavlinkVersion,
17459 __input: &[u8],
17460 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17461 let avail_len = __input.len();
17462 let mut payload_buf = [0; Self::ENCODED_LEN];
17463 let mut buf = if avail_len < Self::ENCODED_LEN {
17464 payload_buf[0..avail_len].copy_from_slice(__input);
17465 Bytes::new(&payload_buf)
17466 } else {
17467 Bytes::new(__input)
17468 };
17469 let mut __struct = Self::default();
17470 __struct.time_usec = buf.get_u64_le()?;
17471 for v in &mut __struct.attitude_quaternion {
17472 let val = buf.get_f32_le()?;
17473 *v = val;
17474 }
17475 __struct.rollspeed = buf.get_f32_le()?;
17476 __struct.pitchspeed = buf.get_f32_le()?;
17477 __struct.yawspeed = buf.get_f32_le()?;
17478 __struct.lat = buf.get_i32_le()?;
17479 __struct.lon = buf.get_i32_le()?;
17480 __struct.alt = buf.get_i32_le()?;
17481 __struct.vx = buf.get_i16_le()?;
17482 __struct.vy = buf.get_i16_le()?;
17483 __struct.vz = buf.get_i16_le()?;
17484 __struct.ind_airspeed = buf.get_u16_le()?;
17485 __struct.true_airspeed = buf.get_u16_le()?;
17486 __struct.xacc = buf.get_i16_le()?;
17487 __struct.yacc = buf.get_i16_le()?;
17488 __struct.zacc = buf.get_i16_le()?;
17489 Ok(__struct)
17490 }
17491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17492 let mut __tmp = BytesMut::new(bytes);
17493 #[allow(clippy::absurd_extreme_comparisons)]
17494 #[allow(unused_comparisons)]
17495 if __tmp.remaining() < Self::ENCODED_LEN {
17496 panic!(
17497 "buffer is too small (need {} bytes, but got {})",
17498 Self::ENCODED_LEN,
17499 __tmp.remaining(),
17500 )
17501 }
17502 __tmp.put_u64_le(self.time_usec);
17503 for val in &self.attitude_quaternion {
17504 __tmp.put_f32_le(*val);
17505 }
17506 __tmp.put_f32_le(self.rollspeed);
17507 __tmp.put_f32_le(self.pitchspeed);
17508 __tmp.put_f32_le(self.yawspeed);
17509 __tmp.put_i32_le(self.lat);
17510 __tmp.put_i32_le(self.lon);
17511 __tmp.put_i32_le(self.alt);
17512 __tmp.put_i16_le(self.vx);
17513 __tmp.put_i16_le(self.vy);
17514 __tmp.put_i16_le(self.vz);
17515 __tmp.put_u16_le(self.ind_airspeed);
17516 __tmp.put_u16_le(self.true_airspeed);
17517 __tmp.put_i16_le(self.xacc);
17518 __tmp.put_i16_le(self.yacc);
17519 __tmp.put_i16_le(self.zacc);
17520 if matches!(version, MavlinkVersion::V2) {
17521 let len = __tmp.len();
17522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17523 } else {
17524 __tmp.len()
17525 }
17526 }
17527}
17528#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17529#[doc = ""]
17530#[doc = "ID: 242"]
17531#[derive(Debug, Clone, PartialEq)]
17532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17534#[cfg_attr(feature = "ts", derive(TS))]
17535#[cfg_attr(feature = "ts", ts(export))]
17536pub struct HOME_POSITION_DATA {
17537 #[doc = "Latitude (WGS84)"]
17538 pub latitude: i32,
17539 #[doc = "Longitude (WGS84)"]
17540 pub longitude: i32,
17541 #[doc = "Altitude (MSL). Positive for up."]
17542 pub altitude: i32,
17543 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17544 pub x: f32,
17545 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17546 pub y: f32,
17547 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17548 pub z: f32,
17549 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17550 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17551 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17552 pub q: [f32; 4],
17553 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17554 pub approach_x: f32,
17555 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17556 pub approach_y: f32,
17557 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17558 pub approach_z: f32,
17559 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17561 pub time_usec: u64,
17562}
17563impl HOME_POSITION_DATA {
17564 pub const ENCODED_LEN: usize = 60usize;
17565 pub const DEFAULT: Self = Self {
17566 latitude: 0_i32,
17567 longitude: 0_i32,
17568 altitude: 0_i32,
17569 x: 0.0_f32,
17570 y: 0.0_f32,
17571 z: 0.0_f32,
17572 q: [0.0_f32; 4usize],
17573 approach_x: 0.0_f32,
17574 approach_y: 0.0_f32,
17575 approach_z: 0.0_f32,
17576 time_usec: 0_u64,
17577 };
17578 #[cfg(feature = "arbitrary")]
17579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17580 use arbitrary::{Arbitrary, Unstructured};
17581 let mut buf = [0u8; 1024];
17582 rng.fill_bytes(&mut buf);
17583 let mut unstructured = Unstructured::new(&buf);
17584 Self::arbitrary(&mut unstructured).unwrap_or_default()
17585 }
17586}
17587impl Default for HOME_POSITION_DATA {
17588 fn default() -> Self {
17589 Self::DEFAULT.clone()
17590 }
17591}
17592impl MessageData for HOME_POSITION_DATA {
17593 type Message = MavMessage;
17594 const ID: u32 = 242u32;
17595 const NAME: &'static str = "HOME_POSITION";
17596 const EXTRA_CRC: u8 = 104u8;
17597 const ENCODED_LEN: usize = 60usize;
17598 fn deser(
17599 _version: MavlinkVersion,
17600 __input: &[u8],
17601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17602 let avail_len = __input.len();
17603 let mut payload_buf = [0; Self::ENCODED_LEN];
17604 let mut buf = if avail_len < Self::ENCODED_LEN {
17605 payload_buf[0..avail_len].copy_from_slice(__input);
17606 Bytes::new(&payload_buf)
17607 } else {
17608 Bytes::new(__input)
17609 };
17610 let mut __struct = Self::default();
17611 __struct.latitude = buf.get_i32_le()?;
17612 __struct.longitude = buf.get_i32_le()?;
17613 __struct.altitude = buf.get_i32_le()?;
17614 __struct.x = buf.get_f32_le()?;
17615 __struct.y = buf.get_f32_le()?;
17616 __struct.z = buf.get_f32_le()?;
17617 for v in &mut __struct.q {
17618 let val = buf.get_f32_le()?;
17619 *v = val;
17620 }
17621 __struct.approach_x = buf.get_f32_le()?;
17622 __struct.approach_y = buf.get_f32_le()?;
17623 __struct.approach_z = buf.get_f32_le()?;
17624 __struct.time_usec = buf.get_u64_le()?;
17625 Ok(__struct)
17626 }
17627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17628 let mut __tmp = BytesMut::new(bytes);
17629 #[allow(clippy::absurd_extreme_comparisons)]
17630 #[allow(unused_comparisons)]
17631 if __tmp.remaining() < Self::ENCODED_LEN {
17632 panic!(
17633 "buffer is too small (need {} bytes, but got {})",
17634 Self::ENCODED_LEN,
17635 __tmp.remaining(),
17636 )
17637 }
17638 __tmp.put_i32_le(self.latitude);
17639 __tmp.put_i32_le(self.longitude);
17640 __tmp.put_i32_le(self.altitude);
17641 __tmp.put_f32_le(self.x);
17642 __tmp.put_f32_le(self.y);
17643 __tmp.put_f32_le(self.z);
17644 for val in &self.q {
17645 __tmp.put_f32_le(*val);
17646 }
17647 __tmp.put_f32_le(self.approach_x);
17648 __tmp.put_f32_le(self.approach_y);
17649 __tmp.put_f32_le(self.approach_z);
17650 if matches!(version, MavlinkVersion::V2) {
17651 __tmp.put_u64_le(self.time_usec);
17652 let len = __tmp.len();
17653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17654 } else {
17655 __tmp.len()
17656 }
17657 }
17658}
17659#[doc = "Temperature and humidity from hygrometer."]
17660#[doc = ""]
17661#[doc = "ID: 12920"]
17662#[derive(Debug, Clone, PartialEq)]
17663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17665#[cfg_attr(feature = "ts", derive(TS))]
17666#[cfg_attr(feature = "ts", ts(export))]
17667pub struct HYGROMETER_SENSOR_DATA {
17668 #[doc = "Temperature"]
17669 pub temperature: i16,
17670 #[doc = "Humidity"]
17671 pub humidity: u16,
17672 #[doc = "Hygrometer ID"]
17673 pub id: u8,
17674}
17675impl HYGROMETER_SENSOR_DATA {
17676 pub const ENCODED_LEN: usize = 5usize;
17677 pub const DEFAULT: Self = Self {
17678 temperature: 0_i16,
17679 humidity: 0_u16,
17680 id: 0_u8,
17681 };
17682 #[cfg(feature = "arbitrary")]
17683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17684 use arbitrary::{Arbitrary, Unstructured};
17685 let mut buf = [0u8; 1024];
17686 rng.fill_bytes(&mut buf);
17687 let mut unstructured = Unstructured::new(&buf);
17688 Self::arbitrary(&mut unstructured).unwrap_or_default()
17689 }
17690}
17691impl Default for HYGROMETER_SENSOR_DATA {
17692 fn default() -> Self {
17693 Self::DEFAULT.clone()
17694 }
17695}
17696impl MessageData for HYGROMETER_SENSOR_DATA {
17697 type Message = MavMessage;
17698 const ID: u32 = 12920u32;
17699 const NAME: &'static str = "HYGROMETER_SENSOR";
17700 const EXTRA_CRC: u8 = 20u8;
17701 const ENCODED_LEN: usize = 5usize;
17702 fn deser(
17703 _version: MavlinkVersion,
17704 __input: &[u8],
17705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17706 let avail_len = __input.len();
17707 let mut payload_buf = [0; Self::ENCODED_LEN];
17708 let mut buf = if avail_len < Self::ENCODED_LEN {
17709 payload_buf[0..avail_len].copy_from_slice(__input);
17710 Bytes::new(&payload_buf)
17711 } else {
17712 Bytes::new(__input)
17713 };
17714 let mut __struct = Self::default();
17715 __struct.temperature = buf.get_i16_le()?;
17716 __struct.humidity = buf.get_u16_le()?;
17717 __struct.id = buf.get_u8()?;
17718 Ok(__struct)
17719 }
17720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17721 let mut __tmp = BytesMut::new(bytes);
17722 #[allow(clippy::absurd_extreme_comparisons)]
17723 #[allow(unused_comparisons)]
17724 if __tmp.remaining() < Self::ENCODED_LEN {
17725 panic!(
17726 "buffer is too small (need {} bytes, but got {})",
17727 Self::ENCODED_LEN,
17728 __tmp.remaining(),
17729 )
17730 }
17731 __tmp.put_i16_le(self.temperature);
17732 __tmp.put_u16_le(self.humidity);
17733 __tmp.put_u8(self.id);
17734 if matches!(version, MavlinkVersion::V2) {
17735 let len = __tmp.len();
17736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17737 } else {
17738 __tmp.len()
17739 }
17740 }
17741}
17742#[doc = "Illuminator status."]
17743#[doc = ""]
17744#[doc = "ID: 440"]
17745#[derive(Debug, Clone, PartialEq)]
17746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17748#[cfg_attr(feature = "ts", derive(TS))]
17749#[cfg_attr(feature = "ts", ts(export))]
17750pub struct ILLUMINATOR_STATUS_DATA {
17751 #[doc = "Time since the start-up of the illuminator in ms"]
17752 pub uptime_ms: u32,
17753 #[doc = "Errors"]
17754 pub error_status: IlluminatorErrorFlags,
17755 #[doc = "Illuminator brightness"]
17756 pub brightness: f32,
17757 #[doc = "Illuminator strobing period in seconds"]
17758 pub strobe_period: f32,
17759 #[doc = "Illuminator strobing duty cycle"]
17760 pub strobe_duty_cycle: f32,
17761 #[doc = "Temperature in Celsius"]
17762 pub temp_c: f32,
17763 #[doc = "Minimum strobing period in seconds"]
17764 pub min_strobe_period: f32,
17765 #[doc = "Maximum strobing period in seconds"]
17766 pub max_strobe_period: f32,
17767 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17768 pub enable: u8,
17769 #[doc = "Supported illuminator modes"]
17770 pub mode_bitmask: IlluminatorMode,
17771 #[doc = "Illuminator mode"]
17772 pub mode: IlluminatorMode,
17773}
17774impl ILLUMINATOR_STATUS_DATA {
17775 pub const ENCODED_LEN: usize = 35usize;
17776 pub const DEFAULT: Self = Self {
17777 uptime_ms: 0_u32,
17778 error_status: IlluminatorErrorFlags::DEFAULT,
17779 brightness: 0.0_f32,
17780 strobe_period: 0.0_f32,
17781 strobe_duty_cycle: 0.0_f32,
17782 temp_c: 0.0_f32,
17783 min_strobe_period: 0.0_f32,
17784 max_strobe_period: 0.0_f32,
17785 enable: 0_u8,
17786 mode_bitmask: IlluminatorMode::DEFAULT,
17787 mode: IlluminatorMode::DEFAULT,
17788 };
17789 #[cfg(feature = "arbitrary")]
17790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17791 use arbitrary::{Arbitrary, Unstructured};
17792 let mut buf = [0u8; 1024];
17793 rng.fill_bytes(&mut buf);
17794 let mut unstructured = Unstructured::new(&buf);
17795 Self::arbitrary(&mut unstructured).unwrap_or_default()
17796 }
17797}
17798impl Default for ILLUMINATOR_STATUS_DATA {
17799 fn default() -> Self {
17800 Self::DEFAULT.clone()
17801 }
17802}
17803impl MessageData for ILLUMINATOR_STATUS_DATA {
17804 type Message = MavMessage;
17805 const ID: u32 = 440u32;
17806 const NAME: &'static str = "ILLUMINATOR_STATUS";
17807 const EXTRA_CRC: u8 = 66u8;
17808 const ENCODED_LEN: usize = 35usize;
17809 fn deser(
17810 _version: MavlinkVersion,
17811 __input: &[u8],
17812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17813 let avail_len = __input.len();
17814 let mut payload_buf = [0; Self::ENCODED_LEN];
17815 let mut buf = if avail_len < Self::ENCODED_LEN {
17816 payload_buf[0..avail_len].copy_from_slice(__input);
17817 Bytes::new(&payload_buf)
17818 } else {
17819 Bytes::new(__input)
17820 };
17821 let mut __struct = Self::default();
17822 __struct.uptime_ms = buf.get_u32_le()?;
17823 let tmp = buf.get_u32_le()?;
17824 __struct.error_status = IlluminatorErrorFlags::from_bits(
17825 tmp as <IlluminatorErrorFlags as Flags>::Bits,
17826 )
17827 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17828 flag_type: "IlluminatorErrorFlags",
17829 value: tmp as u64,
17830 })?;
17831 __struct.brightness = buf.get_f32_le()?;
17832 __struct.strobe_period = buf.get_f32_le()?;
17833 __struct.strobe_duty_cycle = buf.get_f32_le()?;
17834 __struct.temp_c = buf.get_f32_le()?;
17835 __struct.min_strobe_period = buf.get_f32_le()?;
17836 __struct.max_strobe_period = buf.get_f32_le()?;
17837 __struct.enable = buf.get_u8()?;
17838 let tmp = buf.get_u8()?;
17839 __struct.mode_bitmask =
17840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17841 enum_type: "IlluminatorMode",
17842 value: tmp as u64,
17843 })?;
17844 let tmp = buf.get_u8()?;
17845 __struct.mode =
17846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17847 enum_type: "IlluminatorMode",
17848 value: tmp as u64,
17849 })?;
17850 Ok(__struct)
17851 }
17852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17853 let mut __tmp = BytesMut::new(bytes);
17854 #[allow(clippy::absurd_extreme_comparisons)]
17855 #[allow(unused_comparisons)]
17856 if __tmp.remaining() < Self::ENCODED_LEN {
17857 panic!(
17858 "buffer is too small (need {} bytes, but got {})",
17859 Self::ENCODED_LEN,
17860 __tmp.remaining(),
17861 )
17862 }
17863 __tmp.put_u32_le(self.uptime_ms);
17864 __tmp.put_u32_le(self.error_status.bits() as u32);
17865 __tmp.put_f32_le(self.brightness);
17866 __tmp.put_f32_le(self.strobe_period);
17867 __tmp.put_f32_le(self.strobe_duty_cycle);
17868 __tmp.put_f32_le(self.temp_c);
17869 __tmp.put_f32_le(self.min_strobe_period);
17870 __tmp.put_f32_le(self.max_strobe_period);
17871 __tmp.put_u8(self.enable);
17872 __tmp.put_u8(self.mode_bitmask as u8);
17873 __tmp.put_u8(self.mode as u8);
17874 if matches!(version, MavlinkVersion::V2) {
17875 let len = __tmp.len();
17876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17877 } else {
17878 __tmp.len()
17879 }
17880 }
17881}
17882#[doc = "Status of the Iridium SBD link."]
17883#[doc = ""]
17884#[doc = "ID: 335"]
17885#[derive(Debug, Clone, PartialEq)]
17886#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17887#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17888#[cfg_attr(feature = "ts", derive(TS))]
17889#[cfg_attr(feature = "ts", ts(export))]
17890pub struct ISBD_LINK_STATUS_DATA {
17891 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17892 pub timestamp: u64,
17893 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17894 pub last_heartbeat: u64,
17895 #[doc = "Number of failed SBD sessions."]
17896 pub failed_sessions: u16,
17897 #[doc = "Number of successful SBD sessions."]
17898 pub successful_sessions: u16,
17899 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17900 pub signal_quality: u8,
17901 #[doc = "1: Ring call pending, 0: No call pending."]
17902 pub ring_pending: u8,
17903 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17904 pub tx_session_pending: u8,
17905 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17906 pub rx_session_pending: u8,
17907}
17908impl ISBD_LINK_STATUS_DATA {
17909 pub const ENCODED_LEN: usize = 24usize;
17910 pub const DEFAULT: Self = Self {
17911 timestamp: 0_u64,
17912 last_heartbeat: 0_u64,
17913 failed_sessions: 0_u16,
17914 successful_sessions: 0_u16,
17915 signal_quality: 0_u8,
17916 ring_pending: 0_u8,
17917 tx_session_pending: 0_u8,
17918 rx_session_pending: 0_u8,
17919 };
17920 #[cfg(feature = "arbitrary")]
17921 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17922 use arbitrary::{Arbitrary, Unstructured};
17923 let mut buf = [0u8; 1024];
17924 rng.fill_bytes(&mut buf);
17925 let mut unstructured = Unstructured::new(&buf);
17926 Self::arbitrary(&mut unstructured).unwrap_or_default()
17927 }
17928}
17929impl Default for ISBD_LINK_STATUS_DATA {
17930 fn default() -> Self {
17931 Self::DEFAULT.clone()
17932 }
17933}
17934impl MessageData for ISBD_LINK_STATUS_DATA {
17935 type Message = MavMessage;
17936 const ID: u32 = 335u32;
17937 const NAME: &'static str = "ISBD_LINK_STATUS";
17938 const EXTRA_CRC: u8 = 225u8;
17939 const ENCODED_LEN: usize = 24usize;
17940 fn deser(
17941 _version: MavlinkVersion,
17942 __input: &[u8],
17943 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17944 let avail_len = __input.len();
17945 let mut payload_buf = [0; Self::ENCODED_LEN];
17946 let mut buf = if avail_len < Self::ENCODED_LEN {
17947 payload_buf[0..avail_len].copy_from_slice(__input);
17948 Bytes::new(&payload_buf)
17949 } else {
17950 Bytes::new(__input)
17951 };
17952 let mut __struct = Self::default();
17953 __struct.timestamp = buf.get_u64_le()?;
17954 __struct.last_heartbeat = buf.get_u64_le()?;
17955 __struct.failed_sessions = buf.get_u16_le()?;
17956 __struct.successful_sessions = buf.get_u16_le()?;
17957 __struct.signal_quality = buf.get_u8()?;
17958 __struct.ring_pending = buf.get_u8()?;
17959 __struct.tx_session_pending = buf.get_u8()?;
17960 __struct.rx_session_pending = buf.get_u8()?;
17961 Ok(__struct)
17962 }
17963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17964 let mut __tmp = BytesMut::new(bytes);
17965 #[allow(clippy::absurd_extreme_comparisons)]
17966 #[allow(unused_comparisons)]
17967 if __tmp.remaining() < Self::ENCODED_LEN {
17968 panic!(
17969 "buffer is too small (need {} bytes, but got {})",
17970 Self::ENCODED_LEN,
17971 __tmp.remaining(),
17972 )
17973 }
17974 __tmp.put_u64_le(self.timestamp);
17975 __tmp.put_u64_le(self.last_heartbeat);
17976 __tmp.put_u16_le(self.failed_sessions);
17977 __tmp.put_u16_le(self.successful_sessions);
17978 __tmp.put_u8(self.signal_quality);
17979 __tmp.put_u8(self.ring_pending);
17980 __tmp.put_u8(self.tx_session_pending);
17981 __tmp.put_u8(self.rx_session_pending);
17982 if matches!(version, MavlinkVersion::V2) {
17983 let len = __tmp.len();
17984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17985 } else {
17986 __tmp.len()
17987 }
17988 }
17989}
17990#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17991#[doc = ""]
17992#[doc = "ID: 149"]
17993#[derive(Debug, Clone, PartialEq)]
17994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17996#[cfg_attr(feature = "ts", derive(TS))]
17997#[cfg_attr(feature = "ts", ts(export))]
17998pub struct LANDING_TARGET_DATA {
17999 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18000 pub time_usec: u64,
18001 #[doc = "X-axis angular offset of the target from the center of the image"]
18002 pub angle_x: f32,
18003 #[doc = "Y-axis angular offset of the target from the center of the image"]
18004 pub angle_y: f32,
18005 #[doc = "Distance to the target from the vehicle"]
18006 pub distance: f32,
18007 #[doc = "Size of target along x-axis"]
18008 pub size_x: f32,
18009 #[doc = "Size of target along y-axis"]
18010 pub size_y: f32,
18011 #[doc = "The ID of the target if multiple targets are present"]
18012 pub target_num: u8,
18013 #[doc = "Coordinate frame used for following fields."]
18014 pub frame: MavFrame,
18015 #[doc = "X Position of the landing target in MAV_FRAME"]
18016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18017 pub x: f32,
18018 #[doc = "Y Position of the landing target in MAV_FRAME"]
18019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18020 pub y: f32,
18021 #[doc = "Z Position of the landing target in MAV_FRAME"]
18022 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18023 pub z: f32,
18024 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18025 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18027 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18028 pub q: [f32; 4],
18029 #[doc = "Type of landing target"]
18030 #[cfg_attr(feature = "serde", serde(default))]
18031 pub mavtype: LandingTargetType,
18032 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18034 pub position_valid: u8,
18035}
18036impl LANDING_TARGET_DATA {
18037 pub const ENCODED_LEN: usize = 60usize;
18038 pub const DEFAULT: Self = Self {
18039 time_usec: 0_u64,
18040 angle_x: 0.0_f32,
18041 angle_y: 0.0_f32,
18042 distance: 0.0_f32,
18043 size_x: 0.0_f32,
18044 size_y: 0.0_f32,
18045 target_num: 0_u8,
18046 frame: MavFrame::DEFAULT,
18047 x: 0.0_f32,
18048 y: 0.0_f32,
18049 z: 0.0_f32,
18050 q: [0.0_f32; 4usize],
18051 mavtype: LandingTargetType::DEFAULT,
18052 position_valid: 0_u8,
18053 };
18054 #[cfg(feature = "arbitrary")]
18055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18056 use arbitrary::{Arbitrary, Unstructured};
18057 let mut buf = [0u8; 1024];
18058 rng.fill_bytes(&mut buf);
18059 let mut unstructured = Unstructured::new(&buf);
18060 Self::arbitrary(&mut unstructured).unwrap_or_default()
18061 }
18062}
18063impl Default for LANDING_TARGET_DATA {
18064 fn default() -> Self {
18065 Self::DEFAULT.clone()
18066 }
18067}
18068impl MessageData for LANDING_TARGET_DATA {
18069 type Message = MavMessage;
18070 const ID: u32 = 149u32;
18071 const NAME: &'static str = "LANDING_TARGET";
18072 const EXTRA_CRC: u8 = 200u8;
18073 const ENCODED_LEN: usize = 60usize;
18074 fn deser(
18075 _version: MavlinkVersion,
18076 __input: &[u8],
18077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18078 let avail_len = __input.len();
18079 let mut payload_buf = [0; Self::ENCODED_LEN];
18080 let mut buf = if avail_len < Self::ENCODED_LEN {
18081 payload_buf[0..avail_len].copy_from_slice(__input);
18082 Bytes::new(&payload_buf)
18083 } else {
18084 Bytes::new(__input)
18085 };
18086 let mut __struct = Self::default();
18087 __struct.time_usec = buf.get_u64_le()?;
18088 __struct.angle_x = buf.get_f32_le()?;
18089 __struct.angle_y = buf.get_f32_le()?;
18090 __struct.distance = buf.get_f32_le()?;
18091 __struct.size_x = buf.get_f32_le()?;
18092 __struct.size_y = buf.get_f32_le()?;
18093 __struct.target_num = buf.get_u8()?;
18094 let tmp = buf.get_u8()?;
18095 __struct.frame =
18096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18097 enum_type: "MavFrame",
18098 value: tmp as u64,
18099 })?;
18100 __struct.x = buf.get_f32_le()?;
18101 __struct.y = buf.get_f32_le()?;
18102 __struct.z = buf.get_f32_le()?;
18103 for v in &mut __struct.q {
18104 let val = buf.get_f32_le()?;
18105 *v = val;
18106 }
18107 let tmp = buf.get_u8()?;
18108 __struct.mavtype =
18109 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18110 enum_type: "LandingTargetType",
18111 value: tmp as u64,
18112 })?;
18113 __struct.position_valid = buf.get_u8()?;
18114 Ok(__struct)
18115 }
18116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18117 let mut __tmp = BytesMut::new(bytes);
18118 #[allow(clippy::absurd_extreme_comparisons)]
18119 #[allow(unused_comparisons)]
18120 if __tmp.remaining() < Self::ENCODED_LEN {
18121 panic!(
18122 "buffer is too small (need {} bytes, but got {})",
18123 Self::ENCODED_LEN,
18124 __tmp.remaining(),
18125 )
18126 }
18127 __tmp.put_u64_le(self.time_usec);
18128 __tmp.put_f32_le(self.angle_x);
18129 __tmp.put_f32_le(self.angle_y);
18130 __tmp.put_f32_le(self.distance);
18131 __tmp.put_f32_le(self.size_x);
18132 __tmp.put_f32_le(self.size_y);
18133 __tmp.put_u8(self.target_num);
18134 __tmp.put_u8(self.frame as u8);
18135 if matches!(version, MavlinkVersion::V2) {
18136 __tmp.put_f32_le(self.x);
18137 __tmp.put_f32_le(self.y);
18138 __tmp.put_f32_le(self.z);
18139 for val in &self.q {
18140 __tmp.put_f32_le(*val);
18141 }
18142 __tmp.put_u8(self.mavtype as u8);
18143 __tmp.put_u8(self.position_valid);
18144 let len = __tmp.len();
18145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18146 } else {
18147 __tmp.len()
18148 }
18149 }
18150}
18151#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
18152#[doc = ""]
18153#[doc = "ID: 8"]
18154#[derive(Debug, Clone, PartialEq)]
18155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18157#[cfg_attr(feature = "ts", derive(TS))]
18158#[cfg_attr(feature = "ts", ts(export))]
18159pub struct LINK_NODE_STATUS_DATA {
18160 #[doc = "Timestamp (time since system boot)."]
18161 pub timestamp: u64,
18162 #[doc = "Transmit rate"]
18163 pub tx_rate: u32,
18164 #[doc = "Receive rate"]
18165 pub rx_rate: u32,
18166 #[doc = "Messages sent"]
18167 pub messages_sent: u32,
18168 #[doc = "Messages received (estimated from counting seq)"]
18169 pub messages_received: u32,
18170 #[doc = "Messages lost (estimated from counting seq)"]
18171 pub messages_lost: u32,
18172 #[doc = "Number of bytes that could not be parsed correctly."]
18173 pub rx_parse_err: u16,
18174 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18175 pub tx_overflows: u16,
18176 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18177 pub rx_overflows: u16,
18178 #[doc = "Remaining free transmit buffer space"]
18179 pub tx_buf: u8,
18180 #[doc = "Remaining free receive buffer space"]
18181 pub rx_buf: u8,
18182}
18183impl LINK_NODE_STATUS_DATA {
18184 pub const ENCODED_LEN: usize = 36usize;
18185 pub const DEFAULT: Self = Self {
18186 timestamp: 0_u64,
18187 tx_rate: 0_u32,
18188 rx_rate: 0_u32,
18189 messages_sent: 0_u32,
18190 messages_received: 0_u32,
18191 messages_lost: 0_u32,
18192 rx_parse_err: 0_u16,
18193 tx_overflows: 0_u16,
18194 rx_overflows: 0_u16,
18195 tx_buf: 0_u8,
18196 rx_buf: 0_u8,
18197 };
18198 #[cfg(feature = "arbitrary")]
18199 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18200 use arbitrary::{Arbitrary, Unstructured};
18201 let mut buf = [0u8; 1024];
18202 rng.fill_bytes(&mut buf);
18203 let mut unstructured = Unstructured::new(&buf);
18204 Self::arbitrary(&mut unstructured).unwrap_or_default()
18205 }
18206}
18207impl Default for LINK_NODE_STATUS_DATA {
18208 fn default() -> Self {
18209 Self::DEFAULT.clone()
18210 }
18211}
18212impl MessageData for LINK_NODE_STATUS_DATA {
18213 type Message = MavMessage;
18214 const ID: u32 = 8u32;
18215 const NAME: &'static str = "LINK_NODE_STATUS";
18216 const EXTRA_CRC: u8 = 117u8;
18217 const ENCODED_LEN: usize = 36usize;
18218 fn deser(
18219 _version: MavlinkVersion,
18220 __input: &[u8],
18221 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18222 let avail_len = __input.len();
18223 let mut payload_buf = [0; Self::ENCODED_LEN];
18224 let mut buf = if avail_len < Self::ENCODED_LEN {
18225 payload_buf[0..avail_len].copy_from_slice(__input);
18226 Bytes::new(&payload_buf)
18227 } else {
18228 Bytes::new(__input)
18229 };
18230 let mut __struct = Self::default();
18231 __struct.timestamp = buf.get_u64_le()?;
18232 __struct.tx_rate = buf.get_u32_le()?;
18233 __struct.rx_rate = buf.get_u32_le()?;
18234 __struct.messages_sent = buf.get_u32_le()?;
18235 __struct.messages_received = buf.get_u32_le()?;
18236 __struct.messages_lost = buf.get_u32_le()?;
18237 __struct.rx_parse_err = buf.get_u16_le()?;
18238 __struct.tx_overflows = buf.get_u16_le()?;
18239 __struct.rx_overflows = buf.get_u16_le()?;
18240 __struct.tx_buf = buf.get_u8()?;
18241 __struct.rx_buf = buf.get_u8()?;
18242 Ok(__struct)
18243 }
18244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18245 let mut __tmp = BytesMut::new(bytes);
18246 #[allow(clippy::absurd_extreme_comparisons)]
18247 #[allow(unused_comparisons)]
18248 if __tmp.remaining() < Self::ENCODED_LEN {
18249 panic!(
18250 "buffer is too small (need {} bytes, but got {})",
18251 Self::ENCODED_LEN,
18252 __tmp.remaining(),
18253 )
18254 }
18255 __tmp.put_u64_le(self.timestamp);
18256 __tmp.put_u32_le(self.tx_rate);
18257 __tmp.put_u32_le(self.rx_rate);
18258 __tmp.put_u32_le(self.messages_sent);
18259 __tmp.put_u32_le(self.messages_received);
18260 __tmp.put_u32_le(self.messages_lost);
18261 __tmp.put_u16_le(self.rx_parse_err);
18262 __tmp.put_u16_le(self.tx_overflows);
18263 __tmp.put_u16_le(self.rx_overflows);
18264 __tmp.put_u8(self.tx_buf);
18265 __tmp.put_u8(self.rx_buf);
18266 if matches!(version, MavlinkVersion::V2) {
18267 let len = __tmp.len();
18268 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18269 } else {
18270 __tmp.len()
18271 }
18272 }
18273}
18274#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18275#[doc = ""]
18276#[doc = "ID: 32"]
18277#[derive(Debug, Clone, PartialEq)]
18278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18280#[cfg_attr(feature = "ts", derive(TS))]
18281#[cfg_attr(feature = "ts", ts(export))]
18282pub struct LOCAL_POSITION_NED_DATA {
18283 #[doc = "Timestamp (time since system boot)."]
18284 pub time_boot_ms: u32,
18285 #[doc = "X Position"]
18286 pub x: f32,
18287 #[doc = "Y Position"]
18288 pub y: f32,
18289 #[doc = "Z Position"]
18290 pub z: f32,
18291 #[doc = "X Speed"]
18292 pub vx: f32,
18293 #[doc = "Y Speed"]
18294 pub vy: f32,
18295 #[doc = "Z Speed"]
18296 pub vz: f32,
18297}
18298impl LOCAL_POSITION_NED_DATA {
18299 pub const ENCODED_LEN: usize = 28usize;
18300 pub const DEFAULT: Self = Self {
18301 time_boot_ms: 0_u32,
18302 x: 0.0_f32,
18303 y: 0.0_f32,
18304 z: 0.0_f32,
18305 vx: 0.0_f32,
18306 vy: 0.0_f32,
18307 vz: 0.0_f32,
18308 };
18309 #[cfg(feature = "arbitrary")]
18310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18311 use arbitrary::{Arbitrary, Unstructured};
18312 let mut buf = [0u8; 1024];
18313 rng.fill_bytes(&mut buf);
18314 let mut unstructured = Unstructured::new(&buf);
18315 Self::arbitrary(&mut unstructured).unwrap_or_default()
18316 }
18317}
18318impl Default for LOCAL_POSITION_NED_DATA {
18319 fn default() -> Self {
18320 Self::DEFAULT.clone()
18321 }
18322}
18323impl MessageData for LOCAL_POSITION_NED_DATA {
18324 type Message = MavMessage;
18325 const ID: u32 = 32u32;
18326 const NAME: &'static str = "LOCAL_POSITION_NED";
18327 const EXTRA_CRC: u8 = 185u8;
18328 const ENCODED_LEN: usize = 28usize;
18329 fn deser(
18330 _version: MavlinkVersion,
18331 __input: &[u8],
18332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18333 let avail_len = __input.len();
18334 let mut payload_buf = [0; Self::ENCODED_LEN];
18335 let mut buf = if avail_len < Self::ENCODED_LEN {
18336 payload_buf[0..avail_len].copy_from_slice(__input);
18337 Bytes::new(&payload_buf)
18338 } else {
18339 Bytes::new(__input)
18340 };
18341 let mut __struct = Self::default();
18342 __struct.time_boot_ms = buf.get_u32_le()?;
18343 __struct.x = buf.get_f32_le()?;
18344 __struct.y = buf.get_f32_le()?;
18345 __struct.z = buf.get_f32_le()?;
18346 __struct.vx = buf.get_f32_le()?;
18347 __struct.vy = buf.get_f32_le()?;
18348 __struct.vz = buf.get_f32_le()?;
18349 Ok(__struct)
18350 }
18351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18352 let mut __tmp = BytesMut::new(bytes);
18353 #[allow(clippy::absurd_extreme_comparisons)]
18354 #[allow(unused_comparisons)]
18355 if __tmp.remaining() < Self::ENCODED_LEN {
18356 panic!(
18357 "buffer is too small (need {} bytes, but got {})",
18358 Self::ENCODED_LEN,
18359 __tmp.remaining(),
18360 )
18361 }
18362 __tmp.put_u32_le(self.time_boot_ms);
18363 __tmp.put_f32_le(self.x);
18364 __tmp.put_f32_le(self.y);
18365 __tmp.put_f32_le(self.z);
18366 __tmp.put_f32_le(self.vx);
18367 __tmp.put_f32_le(self.vy);
18368 __tmp.put_f32_le(self.vz);
18369 if matches!(version, MavlinkVersion::V2) {
18370 let len = __tmp.len();
18371 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18372 } else {
18373 __tmp.len()
18374 }
18375 }
18376}
18377#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18378#[doc = ""]
18379#[doc = "ID: 64"]
18380#[derive(Debug, Clone, PartialEq)]
18381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18383#[cfg_attr(feature = "ts", derive(TS))]
18384#[cfg_attr(feature = "ts", ts(export))]
18385pub struct LOCAL_POSITION_NED_COV_DATA {
18386 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18387 pub time_usec: u64,
18388 #[doc = "X Position"]
18389 pub x: f32,
18390 #[doc = "Y Position"]
18391 pub y: f32,
18392 #[doc = "Z Position"]
18393 pub z: f32,
18394 #[doc = "X Speed"]
18395 pub vx: f32,
18396 #[doc = "Y Speed"]
18397 pub vy: f32,
18398 #[doc = "Z Speed"]
18399 pub vz: f32,
18400 #[doc = "X Acceleration"]
18401 pub ax: f32,
18402 #[doc = "Y Acceleration"]
18403 pub ay: f32,
18404 #[doc = "Z Acceleration"]
18405 pub az: f32,
18406 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18407 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18408 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18409 pub covariance: [f32; 45],
18410 #[doc = "Class id of the estimator this estimate originated from."]
18411 pub estimator_type: MavEstimatorType,
18412}
18413impl LOCAL_POSITION_NED_COV_DATA {
18414 pub const ENCODED_LEN: usize = 225usize;
18415 pub const DEFAULT: Self = Self {
18416 time_usec: 0_u64,
18417 x: 0.0_f32,
18418 y: 0.0_f32,
18419 z: 0.0_f32,
18420 vx: 0.0_f32,
18421 vy: 0.0_f32,
18422 vz: 0.0_f32,
18423 ax: 0.0_f32,
18424 ay: 0.0_f32,
18425 az: 0.0_f32,
18426 covariance: [0.0_f32; 45usize],
18427 estimator_type: MavEstimatorType::DEFAULT,
18428 };
18429 #[cfg(feature = "arbitrary")]
18430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18431 use arbitrary::{Arbitrary, Unstructured};
18432 let mut buf = [0u8; 1024];
18433 rng.fill_bytes(&mut buf);
18434 let mut unstructured = Unstructured::new(&buf);
18435 Self::arbitrary(&mut unstructured).unwrap_or_default()
18436 }
18437}
18438impl Default for LOCAL_POSITION_NED_COV_DATA {
18439 fn default() -> Self {
18440 Self::DEFAULT.clone()
18441 }
18442}
18443impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18444 type Message = MavMessage;
18445 const ID: u32 = 64u32;
18446 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18447 const EXTRA_CRC: u8 = 191u8;
18448 const ENCODED_LEN: usize = 225usize;
18449 fn deser(
18450 _version: MavlinkVersion,
18451 __input: &[u8],
18452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18453 let avail_len = __input.len();
18454 let mut payload_buf = [0; Self::ENCODED_LEN];
18455 let mut buf = if avail_len < Self::ENCODED_LEN {
18456 payload_buf[0..avail_len].copy_from_slice(__input);
18457 Bytes::new(&payload_buf)
18458 } else {
18459 Bytes::new(__input)
18460 };
18461 let mut __struct = Self::default();
18462 __struct.time_usec = buf.get_u64_le()?;
18463 __struct.x = buf.get_f32_le()?;
18464 __struct.y = buf.get_f32_le()?;
18465 __struct.z = buf.get_f32_le()?;
18466 __struct.vx = buf.get_f32_le()?;
18467 __struct.vy = buf.get_f32_le()?;
18468 __struct.vz = buf.get_f32_le()?;
18469 __struct.ax = buf.get_f32_le()?;
18470 __struct.ay = buf.get_f32_le()?;
18471 __struct.az = buf.get_f32_le()?;
18472 for v in &mut __struct.covariance {
18473 let val = buf.get_f32_le()?;
18474 *v = val;
18475 }
18476 let tmp = buf.get_u8()?;
18477 __struct.estimator_type =
18478 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18479 enum_type: "MavEstimatorType",
18480 value: tmp as u64,
18481 })?;
18482 Ok(__struct)
18483 }
18484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18485 let mut __tmp = BytesMut::new(bytes);
18486 #[allow(clippy::absurd_extreme_comparisons)]
18487 #[allow(unused_comparisons)]
18488 if __tmp.remaining() < Self::ENCODED_LEN {
18489 panic!(
18490 "buffer is too small (need {} bytes, but got {})",
18491 Self::ENCODED_LEN,
18492 __tmp.remaining(),
18493 )
18494 }
18495 __tmp.put_u64_le(self.time_usec);
18496 __tmp.put_f32_le(self.x);
18497 __tmp.put_f32_le(self.y);
18498 __tmp.put_f32_le(self.z);
18499 __tmp.put_f32_le(self.vx);
18500 __tmp.put_f32_le(self.vy);
18501 __tmp.put_f32_le(self.vz);
18502 __tmp.put_f32_le(self.ax);
18503 __tmp.put_f32_le(self.ay);
18504 __tmp.put_f32_le(self.az);
18505 for val in &self.covariance {
18506 __tmp.put_f32_le(*val);
18507 }
18508 __tmp.put_u8(self.estimator_type as u8);
18509 if matches!(version, MavlinkVersion::V2) {
18510 let len = __tmp.len();
18511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18512 } else {
18513 __tmp.len()
18514 }
18515 }
18516}
18517#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18518#[doc = ""]
18519#[doc = "ID: 89"]
18520#[derive(Debug, Clone, PartialEq)]
18521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18523#[cfg_attr(feature = "ts", derive(TS))]
18524#[cfg_attr(feature = "ts", ts(export))]
18525pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18526 #[doc = "Timestamp (time since system boot)."]
18527 pub time_boot_ms: u32,
18528 #[doc = "X Position"]
18529 pub x: f32,
18530 #[doc = "Y Position"]
18531 pub y: f32,
18532 #[doc = "Z Position"]
18533 pub z: f32,
18534 #[doc = "Roll"]
18535 pub roll: f32,
18536 #[doc = "Pitch"]
18537 pub pitch: f32,
18538 #[doc = "Yaw"]
18539 pub yaw: f32,
18540}
18541impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18542 pub const ENCODED_LEN: usize = 28usize;
18543 pub const DEFAULT: Self = Self {
18544 time_boot_ms: 0_u32,
18545 x: 0.0_f32,
18546 y: 0.0_f32,
18547 z: 0.0_f32,
18548 roll: 0.0_f32,
18549 pitch: 0.0_f32,
18550 yaw: 0.0_f32,
18551 };
18552 #[cfg(feature = "arbitrary")]
18553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18554 use arbitrary::{Arbitrary, Unstructured};
18555 let mut buf = [0u8; 1024];
18556 rng.fill_bytes(&mut buf);
18557 let mut unstructured = Unstructured::new(&buf);
18558 Self::arbitrary(&mut unstructured).unwrap_or_default()
18559 }
18560}
18561impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18562 fn default() -> Self {
18563 Self::DEFAULT.clone()
18564 }
18565}
18566impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18567 type Message = MavMessage;
18568 const ID: u32 = 89u32;
18569 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18570 const EXTRA_CRC: u8 = 231u8;
18571 const ENCODED_LEN: usize = 28usize;
18572 fn deser(
18573 _version: MavlinkVersion,
18574 __input: &[u8],
18575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18576 let avail_len = __input.len();
18577 let mut payload_buf = [0; Self::ENCODED_LEN];
18578 let mut buf = if avail_len < Self::ENCODED_LEN {
18579 payload_buf[0..avail_len].copy_from_slice(__input);
18580 Bytes::new(&payload_buf)
18581 } else {
18582 Bytes::new(__input)
18583 };
18584 let mut __struct = Self::default();
18585 __struct.time_boot_ms = buf.get_u32_le()?;
18586 __struct.x = buf.get_f32_le()?;
18587 __struct.y = buf.get_f32_le()?;
18588 __struct.z = buf.get_f32_le()?;
18589 __struct.roll = buf.get_f32_le()?;
18590 __struct.pitch = buf.get_f32_le()?;
18591 __struct.yaw = buf.get_f32_le()?;
18592 Ok(__struct)
18593 }
18594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18595 let mut __tmp = BytesMut::new(bytes);
18596 #[allow(clippy::absurd_extreme_comparisons)]
18597 #[allow(unused_comparisons)]
18598 if __tmp.remaining() < Self::ENCODED_LEN {
18599 panic!(
18600 "buffer is too small (need {} bytes, but got {})",
18601 Self::ENCODED_LEN,
18602 __tmp.remaining(),
18603 )
18604 }
18605 __tmp.put_u32_le(self.time_boot_ms);
18606 __tmp.put_f32_le(self.x);
18607 __tmp.put_f32_le(self.y);
18608 __tmp.put_f32_le(self.z);
18609 __tmp.put_f32_le(self.roll);
18610 __tmp.put_f32_le(self.pitch);
18611 __tmp.put_f32_le(self.yaw);
18612 if matches!(version, MavlinkVersion::V2) {
18613 let len = __tmp.len();
18614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18615 } else {
18616 __tmp.len()
18617 }
18618 }
18619}
18620#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18621#[doc = ""]
18622#[doc = "ID: 268"]
18623#[derive(Debug, Clone, PartialEq)]
18624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18626#[cfg_attr(feature = "ts", derive(TS))]
18627#[cfg_attr(feature = "ts", ts(export))]
18628pub struct LOGGING_ACK_DATA {
18629 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18630 pub sequence: u16,
18631 #[doc = "system ID of the target"]
18632 pub target_system: u8,
18633 #[doc = "component ID of the target"]
18634 pub target_component: u8,
18635}
18636impl LOGGING_ACK_DATA {
18637 pub const ENCODED_LEN: usize = 4usize;
18638 pub const DEFAULT: Self = Self {
18639 sequence: 0_u16,
18640 target_system: 0_u8,
18641 target_component: 0_u8,
18642 };
18643 #[cfg(feature = "arbitrary")]
18644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18645 use arbitrary::{Arbitrary, Unstructured};
18646 let mut buf = [0u8; 1024];
18647 rng.fill_bytes(&mut buf);
18648 let mut unstructured = Unstructured::new(&buf);
18649 Self::arbitrary(&mut unstructured).unwrap_or_default()
18650 }
18651}
18652impl Default for LOGGING_ACK_DATA {
18653 fn default() -> Self {
18654 Self::DEFAULT.clone()
18655 }
18656}
18657impl MessageData for LOGGING_ACK_DATA {
18658 type Message = MavMessage;
18659 const ID: u32 = 268u32;
18660 const NAME: &'static str = "LOGGING_ACK";
18661 const EXTRA_CRC: u8 = 14u8;
18662 const ENCODED_LEN: usize = 4usize;
18663 fn deser(
18664 _version: MavlinkVersion,
18665 __input: &[u8],
18666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18667 let avail_len = __input.len();
18668 let mut payload_buf = [0; Self::ENCODED_LEN];
18669 let mut buf = if avail_len < Self::ENCODED_LEN {
18670 payload_buf[0..avail_len].copy_from_slice(__input);
18671 Bytes::new(&payload_buf)
18672 } else {
18673 Bytes::new(__input)
18674 };
18675 let mut __struct = Self::default();
18676 __struct.sequence = buf.get_u16_le()?;
18677 __struct.target_system = buf.get_u8()?;
18678 __struct.target_component = buf.get_u8()?;
18679 Ok(__struct)
18680 }
18681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18682 let mut __tmp = BytesMut::new(bytes);
18683 #[allow(clippy::absurd_extreme_comparisons)]
18684 #[allow(unused_comparisons)]
18685 if __tmp.remaining() < Self::ENCODED_LEN {
18686 panic!(
18687 "buffer is too small (need {} bytes, but got {})",
18688 Self::ENCODED_LEN,
18689 __tmp.remaining(),
18690 )
18691 }
18692 __tmp.put_u16_le(self.sequence);
18693 __tmp.put_u8(self.target_system);
18694 __tmp.put_u8(self.target_component);
18695 if matches!(version, MavlinkVersion::V2) {
18696 let len = __tmp.len();
18697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18698 } else {
18699 __tmp.len()
18700 }
18701 }
18702}
18703#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18704#[doc = ""]
18705#[doc = "ID: 266"]
18706#[derive(Debug, Clone, PartialEq)]
18707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18709#[cfg_attr(feature = "ts", derive(TS))]
18710#[cfg_attr(feature = "ts", ts(export))]
18711pub struct LOGGING_DATA_DATA {
18712 #[doc = "sequence number (can wrap)"]
18713 pub sequence: u16,
18714 #[doc = "system ID of the target"]
18715 pub target_system: u8,
18716 #[doc = "component ID of the target"]
18717 pub target_component: u8,
18718 #[doc = "data length"]
18719 pub length: u8,
18720 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18721 pub first_message_offset: u8,
18722 #[doc = "logged data"]
18723 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18724 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18725 pub data: [u8; 249],
18726}
18727impl LOGGING_DATA_DATA {
18728 pub const ENCODED_LEN: usize = 255usize;
18729 pub const DEFAULT: Self = Self {
18730 sequence: 0_u16,
18731 target_system: 0_u8,
18732 target_component: 0_u8,
18733 length: 0_u8,
18734 first_message_offset: 0_u8,
18735 data: [0_u8; 249usize],
18736 };
18737 #[cfg(feature = "arbitrary")]
18738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18739 use arbitrary::{Arbitrary, Unstructured};
18740 let mut buf = [0u8; 1024];
18741 rng.fill_bytes(&mut buf);
18742 let mut unstructured = Unstructured::new(&buf);
18743 Self::arbitrary(&mut unstructured).unwrap_or_default()
18744 }
18745}
18746impl Default for LOGGING_DATA_DATA {
18747 fn default() -> Self {
18748 Self::DEFAULT.clone()
18749 }
18750}
18751impl MessageData for LOGGING_DATA_DATA {
18752 type Message = MavMessage;
18753 const ID: u32 = 266u32;
18754 const NAME: &'static str = "LOGGING_DATA";
18755 const EXTRA_CRC: u8 = 193u8;
18756 const ENCODED_LEN: usize = 255usize;
18757 fn deser(
18758 _version: MavlinkVersion,
18759 __input: &[u8],
18760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18761 let avail_len = __input.len();
18762 let mut payload_buf = [0; Self::ENCODED_LEN];
18763 let mut buf = if avail_len < Self::ENCODED_LEN {
18764 payload_buf[0..avail_len].copy_from_slice(__input);
18765 Bytes::new(&payload_buf)
18766 } else {
18767 Bytes::new(__input)
18768 };
18769 let mut __struct = Self::default();
18770 __struct.sequence = buf.get_u16_le()?;
18771 __struct.target_system = buf.get_u8()?;
18772 __struct.target_component = buf.get_u8()?;
18773 __struct.length = buf.get_u8()?;
18774 __struct.first_message_offset = buf.get_u8()?;
18775 for v in &mut __struct.data {
18776 let val = buf.get_u8()?;
18777 *v = val;
18778 }
18779 Ok(__struct)
18780 }
18781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18782 let mut __tmp = BytesMut::new(bytes);
18783 #[allow(clippy::absurd_extreme_comparisons)]
18784 #[allow(unused_comparisons)]
18785 if __tmp.remaining() < Self::ENCODED_LEN {
18786 panic!(
18787 "buffer is too small (need {} bytes, but got {})",
18788 Self::ENCODED_LEN,
18789 __tmp.remaining(),
18790 )
18791 }
18792 __tmp.put_u16_le(self.sequence);
18793 __tmp.put_u8(self.target_system);
18794 __tmp.put_u8(self.target_component);
18795 __tmp.put_u8(self.length);
18796 __tmp.put_u8(self.first_message_offset);
18797 for val in &self.data {
18798 __tmp.put_u8(*val);
18799 }
18800 if matches!(version, MavlinkVersion::V2) {
18801 let len = __tmp.len();
18802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18803 } else {
18804 __tmp.len()
18805 }
18806 }
18807}
18808#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18809#[doc = ""]
18810#[doc = "ID: 267"]
18811#[derive(Debug, Clone, PartialEq)]
18812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18814#[cfg_attr(feature = "ts", derive(TS))]
18815#[cfg_attr(feature = "ts", ts(export))]
18816pub struct LOGGING_DATA_ACKED_DATA {
18817 #[doc = "sequence number (can wrap)"]
18818 pub sequence: u16,
18819 #[doc = "system ID of the target"]
18820 pub target_system: u8,
18821 #[doc = "component ID of the target"]
18822 pub target_component: u8,
18823 #[doc = "data length"]
18824 pub length: u8,
18825 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18826 pub first_message_offset: u8,
18827 #[doc = "logged data"]
18828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18829 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18830 pub data: [u8; 249],
18831}
18832impl LOGGING_DATA_ACKED_DATA {
18833 pub const ENCODED_LEN: usize = 255usize;
18834 pub const DEFAULT: Self = Self {
18835 sequence: 0_u16,
18836 target_system: 0_u8,
18837 target_component: 0_u8,
18838 length: 0_u8,
18839 first_message_offset: 0_u8,
18840 data: [0_u8; 249usize],
18841 };
18842 #[cfg(feature = "arbitrary")]
18843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18844 use arbitrary::{Arbitrary, Unstructured};
18845 let mut buf = [0u8; 1024];
18846 rng.fill_bytes(&mut buf);
18847 let mut unstructured = Unstructured::new(&buf);
18848 Self::arbitrary(&mut unstructured).unwrap_or_default()
18849 }
18850}
18851impl Default for LOGGING_DATA_ACKED_DATA {
18852 fn default() -> Self {
18853 Self::DEFAULT.clone()
18854 }
18855}
18856impl MessageData for LOGGING_DATA_ACKED_DATA {
18857 type Message = MavMessage;
18858 const ID: u32 = 267u32;
18859 const NAME: &'static str = "LOGGING_DATA_ACKED";
18860 const EXTRA_CRC: u8 = 35u8;
18861 const ENCODED_LEN: usize = 255usize;
18862 fn deser(
18863 _version: MavlinkVersion,
18864 __input: &[u8],
18865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18866 let avail_len = __input.len();
18867 let mut payload_buf = [0; Self::ENCODED_LEN];
18868 let mut buf = if avail_len < Self::ENCODED_LEN {
18869 payload_buf[0..avail_len].copy_from_slice(__input);
18870 Bytes::new(&payload_buf)
18871 } else {
18872 Bytes::new(__input)
18873 };
18874 let mut __struct = Self::default();
18875 __struct.sequence = buf.get_u16_le()?;
18876 __struct.target_system = buf.get_u8()?;
18877 __struct.target_component = buf.get_u8()?;
18878 __struct.length = buf.get_u8()?;
18879 __struct.first_message_offset = buf.get_u8()?;
18880 for v in &mut __struct.data {
18881 let val = buf.get_u8()?;
18882 *v = val;
18883 }
18884 Ok(__struct)
18885 }
18886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18887 let mut __tmp = BytesMut::new(bytes);
18888 #[allow(clippy::absurd_extreme_comparisons)]
18889 #[allow(unused_comparisons)]
18890 if __tmp.remaining() < Self::ENCODED_LEN {
18891 panic!(
18892 "buffer is too small (need {} bytes, but got {})",
18893 Self::ENCODED_LEN,
18894 __tmp.remaining(),
18895 )
18896 }
18897 __tmp.put_u16_le(self.sequence);
18898 __tmp.put_u8(self.target_system);
18899 __tmp.put_u8(self.target_component);
18900 __tmp.put_u8(self.length);
18901 __tmp.put_u8(self.first_message_offset);
18902 for val in &self.data {
18903 __tmp.put_u8(*val);
18904 }
18905 if matches!(version, MavlinkVersion::V2) {
18906 let len = __tmp.len();
18907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18908 } else {
18909 __tmp.len()
18910 }
18911 }
18912}
18913#[doc = "Reply to LOG_REQUEST_DATA."]
18914#[doc = ""]
18915#[doc = "ID: 120"]
18916#[derive(Debug, Clone, PartialEq)]
18917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18919#[cfg_attr(feature = "ts", derive(TS))]
18920#[cfg_attr(feature = "ts", ts(export))]
18921pub struct LOG_DATA_DATA {
18922 #[doc = "Offset into the log"]
18923 pub ofs: u32,
18924 #[doc = "Log id (from LOG_ENTRY reply)"]
18925 pub id: u16,
18926 #[doc = "Number of bytes (zero for end of log)"]
18927 pub count: u8,
18928 #[doc = "log data"]
18929 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18930 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18931 pub data: [u8; 90],
18932}
18933impl LOG_DATA_DATA {
18934 pub const ENCODED_LEN: usize = 97usize;
18935 pub const DEFAULT: Self = Self {
18936 ofs: 0_u32,
18937 id: 0_u16,
18938 count: 0_u8,
18939 data: [0_u8; 90usize],
18940 };
18941 #[cfg(feature = "arbitrary")]
18942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18943 use arbitrary::{Arbitrary, Unstructured};
18944 let mut buf = [0u8; 1024];
18945 rng.fill_bytes(&mut buf);
18946 let mut unstructured = Unstructured::new(&buf);
18947 Self::arbitrary(&mut unstructured).unwrap_or_default()
18948 }
18949}
18950impl Default for LOG_DATA_DATA {
18951 fn default() -> Self {
18952 Self::DEFAULT.clone()
18953 }
18954}
18955impl MessageData for LOG_DATA_DATA {
18956 type Message = MavMessage;
18957 const ID: u32 = 120u32;
18958 const NAME: &'static str = "LOG_DATA";
18959 const EXTRA_CRC: u8 = 134u8;
18960 const ENCODED_LEN: usize = 97usize;
18961 fn deser(
18962 _version: MavlinkVersion,
18963 __input: &[u8],
18964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18965 let avail_len = __input.len();
18966 let mut payload_buf = [0; Self::ENCODED_LEN];
18967 let mut buf = if avail_len < Self::ENCODED_LEN {
18968 payload_buf[0..avail_len].copy_from_slice(__input);
18969 Bytes::new(&payload_buf)
18970 } else {
18971 Bytes::new(__input)
18972 };
18973 let mut __struct = Self::default();
18974 __struct.ofs = buf.get_u32_le()?;
18975 __struct.id = buf.get_u16_le()?;
18976 __struct.count = buf.get_u8()?;
18977 for v in &mut __struct.data {
18978 let val = buf.get_u8()?;
18979 *v = val;
18980 }
18981 Ok(__struct)
18982 }
18983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18984 let mut __tmp = BytesMut::new(bytes);
18985 #[allow(clippy::absurd_extreme_comparisons)]
18986 #[allow(unused_comparisons)]
18987 if __tmp.remaining() < Self::ENCODED_LEN {
18988 panic!(
18989 "buffer is too small (need {} bytes, but got {})",
18990 Self::ENCODED_LEN,
18991 __tmp.remaining(),
18992 )
18993 }
18994 __tmp.put_u32_le(self.ofs);
18995 __tmp.put_u16_le(self.id);
18996 __tmp.put_u8(self.count);
18997 for val in &self.data {
18998 __tmp.put_u8(*val);
18999 }
19000 if matches!(version, MavlinkVersion::V2) {
19001 let len = __tmp.len();
19002 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19003 } else {
19004 __tmp.len()
19005 }
19006 }
19007}
19008#[doc = "Reply to LOG_REQUEST_LIST."]
19009#[doc = ""]
19010#[doc = "ID: 118"]
19011#[derive(Debug, Clone, PartialEq)]
19012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19014#[cfg_attr(feature = "ts", derive(TS))]
19015#[cfg_attr(feature = "ts", ts(export))]
19016pub struct LOG_ENTRY_DATA {
19017 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19018 pub time_utc: u32,
19019 #[doc = "Size of the log (may be approximate)"]
19020 pub size: u32,
19021 #[doc = "Log id"]
19022 pub id: u16,
19023 #[doc = "Total number of logs"]
19024 pub num_logs: u16,
19025 #[doc = "High log number"]
19026 pub last_log_num: u16,
19027}
19028impl LOG_ENTRY_DATA {
19029 pub const ENCODED_LEN: usize = 14usize;
19030 pub const DEFAULT: Self = Self {
19031 time_utc: 0_u32,
19032 size: 0_u32,
19033 id: 0_u16,
19034 num_logs: 0_u16,
19035 last_log_num: 0_u16,
19036 };
19037 #[cfg(feature = "arbitrary")]
19038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19039 use arbitrary::{Arbitrary, Unstructured};
19040 let mut buf = [0u8; 1024];
19041 rng.fill_bytes(&mut buf);
19042 let mut unstructured = Unstructured::new(&buf);
19043 Self::arbitrary(&mut unstructured).unwrap_or_default()
19044 }
19045}
19046impl Default for LOG_ENTRY_DATA {
19047 fn default() -> Self {
19048 Self::DEFAULT.clone()
19049 }
19050}
19051impl MessageData for LOG_ENTRY_DATA {
19052 type Message = MavMessage;
19053 const ID: u32 = 118u32;
19054 const NAME: &'static str = "LOG_ENTRY";
19055 const EXTRA_CRC: u8 = 56u8;
19056 const ENCODED_LEN: usize = 14usize;
19057 fn deser(
19058 _version: MavlinkVersion,
19059 __input: &[u8],
19060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19061 let avail_len = __input.len();
19062 let mut payload_buf = [0; Self::ENCODED_LEN];
19063 let mut buf = if avail_len < Self::ENCODED_LEN {
19064 payload_buf[0..avail_len].copy_from_slice(__input);
19065 Bytes::new(&payload_buf)
19066 } else {
19067 Bytes::new(__input)
19068 };
19069 let mut __struct = Self::default();
19070 __struct.time_utc = buf.get_u32_le()?;
19071 __struct.size = buf.get_u32_le()?;
19072 __struct.id = buf.get_u16_le()?;
19073 __struct.num_logs = buf.get_u16_le()?;
19074 __struct.last_log_num = buf.get_u16_le()?;
19075 Ok(__struct)
19076 }
19077 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19078 let mut __tmp = BytesMut::new(bytes);
19079 #[allow(clippy::absurd_extreme_comparisons)]
19080 #[allow(unused_comparisons)]
19081 if __tmp.remaining() < Self::ENCODED_LEN {
19082 panic!(
19083 "buffer is too small (need {} bytes, but got {})",
19084 Self::ENCODED_LEN,
19085 __tmp.remaining(),
19086 )
19087 }
19088 __tmp.put_u32_le(self.time_utc);
19089 __tmp.put_u32_le(self.size);
19090 __tmp.put_u16_le(self.id);
19091 __tmp.put_u16_le(self.num_logs);
19092 __tmp.put_u16_le(self.last_log_num);
19093 if matches!(version, MavlinkVersion::V2) {
19094 let len = __tmp.len();
19095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19096 } else {
19097 __tmp.len()
19098 }
19099 }
19100}
19101#[doc = "Erase all logs."]
19102#[doc = ""]
19103#[doc = "ID: 121"]
19104#[derive(Debug, Clone, PartialEq)]
19105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19107#[cfg_attr(feature = "ts", derive(TS))]
19108#[cfg_attr(feature = "ts", ts(export))]
19109pub struct LOG_ERASE_DATA {
19110 #[doc = "System ID"]
19111 pub target_system: u8,
19112 #[doc = "Component ID"]
19113 pub target_component: u8,
19114}
19115impl LOG_ERASE_DATA {
19116 pub const ENCODED_LEN: usize = 2usize;
19117 pub const DEFAULT: Self = Self {
19118 target_system: 0_u8,
19119 target_component: 0_u8,
19120 };
19121 #[cfg(feature = "arbitrary")]
19122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19123 use arbitrary::{Arbitrary, Unstructured};
19124 let mut buf = [0u8; 1024];
19125 rng.fill_bytes(&mut buf);
19126 let mut unstructured = Unstructured::new(&buf);
19127 Self::arbitrary(&mut unstructured).unwrap_or_default()
19128 }
19129}
19130impl Default for LOG_ERASE_DATA {
19131 fn default() -> Self {
19132 Self::DEFAULT.clone()
19133 }
19134}
19135impl MessageData for LOG_ERASE_DATA {
19136 type Message = MavMessage;
19137 const ID: u32 = 121u32;
19138 const NAME: &'static str = "LOG_ERASE";
19139 const EXTRA_CRC: u8 = 237u8;
19140 const ENCODED_LEN: usize = 2usize;
19141 fn deser(
19142 _version: MavlinkVersion,
19143 __input: &[u8],
19144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19145 let avail_len = __input.len();
19146 let mut payload_buf = [0; Self::ENCODED_LEN];
19147 let mut buf = if avail_len < Self::ENCODED_LEN {
19148 payload_buf[0..avail_len].copy_from_slice(__input);
19149 Bytes::new(&payload_buf)
19150 } else {
19151 Bytes::new(__input)
19152 };
19153 let mut __struct = Self::default();
19154 __struct.target_system = buf.get_u8()?;
19155 __struct.target_component = buf.get_u8()?;
19156 Ok(__struct)
19157 }
19158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19159 let mut __tmp = BytesMut::new(bytes);
19160 #[allow(clippy::absurd_extreme_comparisons)]
19161 #[allow(unused_comparisons)]
19162 if __tmp.remaining() < Self::ENCODED_LEN {
19163 panic!(
19164 "buffer is too small (need {} bytes, but got {})",
19165 Self::ENCODED_LEN,
19166 __tmp.remaining(),
19167 )
19168 }
19169 __tmp.put_u8(self.target_system);
19170 __tmp.put_u8(self.target_component);
19171 if matches!(version, MavlinkVersion::V2) {
19172 let len = __tmp.len();
19173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19174 } else {
19175 __tmp.len()
19176 }
19177 }
19178}
19179#[doc = "Request a chunk of a log."]
19180#[doc = ""]
19181#[doc = "ID: 119"]
19182#[derive(Debug, Clone, PartialEq)]
19183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19185#[cfg_attr(feature = "ts", derive(TS))]
19186#[cfg_attr(feature = "ts", ts(export))]
19187pub struct LOG_REQUEST_DATA_DATA {
19188 #[doc = "Offset into the log"]
19189 pub ofs: u32,
19190 #[doc = "Number of bytes"]
19191 pub count: u32,
19192 #[doc = "Log id (from LOG_ENTRY reply)"]
19193 pub id: u16,
19194 #[doc = "System ID"]
19195 pub target_system: u8,
19196 #[doc = "Component ID"]
19197 pub target_component: u8,
19198}
19199impl LOG_REQUEST_DATA_DATA {
19200 pub const ENCODED_LEN: usize = 12usize;
19201 pub const DEFAULT: Self = Self {
19202 ofs: 0_u32,
19203 count: 0_u32,
19204 id: 0_u16,
19205 target_system: 0_u8,
19206 target_component: 0_u8,
19207 };
19208 #[cfg(feature = "arbitrary")]
19209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19210 use arbitrary::{Arbitrary, Unstructured};
19211 let mut buf = [0u8; 1024];
19212 rng.fill_bytes(&mut buf);
19213 let mut unstructured = Unstructured::new(&buf);
19214 Self::arbitrary(&mut unstructured).unwrap_or_default()
19215 }
19216}
19217impl Default for LOG_REQUEST_DATA_DATA {
19218 fn default() -> Self {
19219 Self::DEFAULT.clone()
19220 }
19221}
19222impl MessageData for LOG_REQUEST_DATA_DATA {
19223 type Message = MavMessage;
19224 const ID: u32 = 119u32;
19225 const NAME: &'static str = "LOG_REQUEST_DATA";
19226 const EXTRA_CRC: u8 = 116u8;
19227 const ENCODED_LEN: usize = 12usize;
19228 fn deser(
19229 _version: MavlinkVersion,
19230 __input: &[u8],
19231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19232 let avail_len = __input.len();
19233 let mut payload_buf = [0; Self::ENCODED_LEN];
19234 let mut buf = if avail_len < Self::ENCODED_LEN {
19235 payload_buf[0..avail_len].copy_from_slice(__input);
19236 Bytes::new(&payload_buf)
19237 } else {
19238 Bytes::new(__input)
19239 };
19240 let mut __struct = Self::default();
19241 __struct.ofs = buf.get_u32_le()?;
19242 __struct.count = buf.get_u32_le()?;
19243 __struct.id = buf.get_u16_le()?;
19244 __struct.target_system = buf.get_u8()?;
19245 __struct.target_component = buf.get_u8()?;
19246 Ok(__struct)
19247 }
19248 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19249 let mut __tmp = BytesMut::new(bytes);
19250 #[allow(clippy::absurd_extreme_comparisons)]
19251 #[allow(unused_comparisons)]
19252 if __tmp.remaining() < Self::ENCODED_LEN {
19253 panic!(
19254 "buffer is too small (need {} bytes, but got {})",
19255 Self::ENCODED_LEN,
19256 __tmp.remaining(),
19257 )
19258 }
19259 __tmp.put_u32_le(self.ofs);
19260 __tmp.put_u32_le(self.count);
19261 __tmp.put_u16_le(self.id);
19262 __tmp.put_u8(self.target_system);
19263 __tmp.put_u8(self.target_component);
19264 if matches!(version, MavlinkVersion::V2) {
19265 let len = __tmp.len();
19266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19267 } else {
19268 __tmp.len()
19269 }
19270 }
19271}
19272#[doc = "Stop log transfer and resume normal logging."]
19273#[doc = ""]
19274#[doc = "ID: 122"]
19275#[derive(Debug, Clone, PartialEq)]
19276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19278#[cfg_attr(feature = "ts", derive(TS))]
19279#[cfg_attr(feature = "ts", ts(export))]
19280pub struct LOG_REQUEST_END_DATA {
19281 #[doc = "System ID"]
19282 pub target_system: u8,
19283 #[doc = "Component ID"]
19284 pub target_component: u8,
19285}
19286impl LOG_REQUEST_END_DATA {
19287 pub const ENCODED_LEN: usize = 2usize;
19288 pub const DEFAULT: Self = Self {
19289 target_system: 0_u8,
19290 target_component: 0_u8,
19291 };
19292 #[cfg(feature = "arbitrary")]
19293 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19294 use arbitrary::{Arbitrary, Unstructured};
19295 let mut buf = [0u8; 1024];
19296 rng.fill_bytes(&mut buf);
19297 let mut unstructured = Unstructured::new(&buf);
19298 Self::arbitrary(&mut unstructured).unwrap_or_default()
19299 }
19300}
19301impl Default for LOG_REQUEST_END_DATA {
19302 fn default() -> Self {
19303 Self::DEFAULT.clone()
19304 }
19305}
19306impl MessageData for LOG_REQUEST_END_DATA {
19307 type Message = MavMessage;
19308 const ID: u32 = 122u32;
19309 const NAME: &'static str = "LOG_REQUEST_END";
19310 const EXTRA_CRC: u8 = 203u8;
19311 const ENCODED_LEN: usize = 2usize;
19312 fn deser(
19313 _version: MavlinkVersion,
19314 __input: &[u8],
19315 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19316 let avail_len = __input.len();
19317 let mut payload_buf = [0; Self::ENCODED_LEN];
19318 let mut buf = if avail_len < Self::ENCODED_LEN {
19319 payload_buf[0..avail_len].copy_from_slice(__input);
19320 Bytes::new(&payload_buf)
19321 } else {
19322 Bytes::new(__input)
19323 };
19324 let mut __struct = Self::default();
19325 __struct.target_system = buf.get_u8()?;
19326 __struct.target_component = buf.get_u8()?;
19327 Ok(__struct)
19328 }
19329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19330 let mut __tmp = BytesMut::new(bytes);
19331 #[allow(clippy::absurd_extreme_comparisons)]
19332 #[allow(unused_comparisons)]
19333 if __tmp.remaining() < Self::ENCODED_LEN {
19334 panic!(
19335 "buffer is too small (need {} bytes, but got {})",
19336 Self::ENCODED_LEN,
19337 __tmp.remaining(),
19338 )
19339 }
19340 __tmp.put_u8(self.target_system);
19341 __tmp.put_u8(self.target_component);
19342 if matches!(version, MavlinkVersion::V2) {
19343 let len = __tmp.len();
19344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19345 } else {
19346 __tmp.len()
19347 }
19348 }
19349}
19350#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19351#[doc = ""]
19352#[doc = "ID: 117"]
19353#[derive(Debug, Clone, PartialEq)]
19354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19356#[cfg_attr(feature = "ts", derive(TS))]
19357#[cfg_attr(feature = "ts", ts(export))]
19358pub struct LOG_REQUEST_LIST_DATA {
19359 #[doc = "First log id (0 for first available)"]
19360 pub start: u16,
19361 #[doc = "Last log id (0xffff for last available)"]
19362 pub end: u16,
19363 #[doc = "System ID"]
19364 pub target_system: u8,
19365 #[doc = "Component ID"]
19366 pub target_component: u8,
19367}
19368impl LOG_REQUEST_LIST_DATA {
19369 pub const ENCODED_LEN: usize = 6usize;
19370 pub const DEFAULT: Self = Self {
19371 start: 0_u16,
19372 end: 0_u16,
19373 target_system: 0_u8,
19374 target_component: 0_u8,
19375 };
19376 #[cfg(feature = "arbitrary")]
19377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19378 use arbitrary::{Arbitrary, Unstructured};
19379 let mut buf = [0u8; 1024];
19380 rng.fill_bytes(&mut buf);
19381 let mut unstructured = Unstructured::new(&buf);
19382 Self::arbitrary(&mut unstructured).unwrap_or_default()
19383 }
19384}
19385impl Default for LOG_REQUEST_LIST_DATA {
19386 fn default() -> Self {
19387 Self::DEFAULT.clone()
19388 }
19389}
19390impl MessageData for LOG_REQUEST_LIST_DATA {
19391 type Message = MavMessage;
19392 const ID: u32 = 117u32;
19393 const NAME: &'static str = "LOG_REQUEST_LIST";
19394 const EXTRA_CRC: u8 = 128u8;
19395 const ENCODED_LEN: usize = 6usize;
19396 fn deser(
19397 _version: MavlinkVersion,
19398 __input: &[u8],
19399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19400 let avail_len = __input.len();
19401 let mut payload_buf = [0; Self::ENCODED_LEN];
19402 let mut buf = if avail_len < Self::ENCODED_LEN {
19403 payload_buf[0..avail_len].copy_from_slice(__input);
19404 Bytes::new(&payload_buf)
19405 } else {
19406 Bytes::new(__input)
19407 };
19408 let mut __struct = Self::default();
19409 __struct.start = buf.get_u16_le()?;
19410 __struct.end = buf.get_u16_le()?;
19411 __struct.target_system = buf.get_u8()?;
19412 __struct.target_component = buf.get_u8()?;
19413 Ok(__struct)
19414 }
19415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19416 let mut __tmp = BytesMut::new(bytes);
19417 #[allow(clippy::absurd_extreme_comparisons)]
19418 #[allow(unused_comparisons)]
19419 if __tmp.remaining() < Self::ENCODED_LEN {
19420 panic!(
19421 "buffer is too small (need {} bytes, but got {})",
19422 Self::ENCODED_LEN,
19423 __tmp.remaining(),
19424 )
19425 }
19426 __tmp.put_u16_le(self.start);
19427 __tmp.put_u16_le(self.end);
19428 __tmp.put_u8(self.target_system);
19429 __tmp.put_u8(self.target_component);
19430 if matches!(version, MavlinkVersion::V2) {
19431 let len = __tmp.len();
19432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19433 } else {
19434 __tmp.len()
19435 }
19436 }
19437}
19438#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19439#[doc = ""]
19440#[doc = "ID: 192"]
19441#[derive(Debug, Clone, PartialEq)]
19442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19444#[cfg_attr(feature = "ts", derive(TS))]
19445#[cfg_attr(feature = "ts", ts(export))]
19446pub struct MAG_CAL_REPORT_DATA {
19447 #[doc = "RMS milligauss residuals."]
19448 pub fitness: f32,
19449 #[doc = "X offset."]
19450 pub ofs_x: f32,
19451 #[doc = "Y offset."]
19452 pub ofs_y: f32,
19453 #[doc = "Z offset."]
19454 pub ofs_z: f32,
19455 #[doc = "X diagonal (matrix 11)."]
19456 pub diag_x: f32,
19457 #[doc = "Y diagonal (matrix 22)."]
19458 pub diag_y: f32,
19459 #[doc = "Z diagonal (matrix 33)."]
19460 pub diag_z: f32,
19461 #[doc = "X off-diagonal (matrix 12 and 21)."]
19462 pub offdiag_x: f32,
19463 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19464 pub offdiag_y: f32,
19465 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19466 pub offdiag_z: f32,
19467 #[doc = "Compass being calibrated."]
19468 pub compass_id: u8,
19469 #[doc = "Bitmask of compasses being calibrated."]
19470 pub cal_mask: u8,
19471 #[doc = "Calibration Status."]
19472 pub cal_status: MagCalStatus,
19473 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19474 pub autosaved: u8,
19475 #[doc = "Confidence in orientation (higher is better)."]
19476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19477 pub orientation_confidence: f32,
19478 #[doc = "orientation before calibration."]
19479 #[cfg_attr(feature = "serde", serde(default))]
19480 pub old_orientation: MavSensorOrientation,
19481 #[doc = "orientation after calibration."]
19482 #[cfg_attr(feature = "serde", serde(default))]
19483 pub new_orientation: MavSensorOrientation,
19484 #[doc = "field radius correction factor"]
19485 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19486 pub scale_factor: f32,
19487}
19488impl MAG_CAL_REPORT_DATA {
19489 pub const ENCODED_LEN: usize = 54usize;
19490 pub const DEFAULT: Self = Self {
19491 fitness: 0.0_f32,
19492 ofs_x: 0.0_f32,
19493 ofs_y: 0.0_f32,
19494 ofs_z: 0.0_f32,
19495 diag_x: 0.0_f32,
19496 diag_y: 0.0_f32,
19497 diag_z: 0.0_f32,
19498 offdiag_x: 0.0_f32,
19499 offdiag_y: 0.0_f32,
19500 offdiag_z: 0.0_f32,
19501 compass_id: 0_u8,
19502 cal_mask: 0_u8,
19503 cal_status: MagCalStatus::DEFAULT,
19504 autosaved: 0_u8,
19505 orientation_confidence: 0.0_f32,
19506 old_orientation: MavSensorOrientation::DEFAULT,
19507 new_orientation: MavSensorOrientation::DEFAULT,
19508 scale_factor: 0.0_f32,
19509 };
19510 #[cfg(feature = "arbitrary")]
19511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19512 use arbitrary::{Arbitrary, Unstructured};
19513 let mut buf = [0u8; 1024];
19514 rng.fill_bytes(&mut buf);
19515 let mut unstructured = Unstructured::new(&buf);
19516 Self::arbitrary(&mut unstructured).unwrap_or_default()
19517 }
19518}
19519impl Default for MAG_CAL_REPORT_DATA {
19520 fn default() -> Self {
19521 Self::DEFAULT.clone()
19522 }
19523}
19524impl MessageData for MAG_CAL_REPORT_DATA {
19525 type Message = MavMessage;
19526 const ID: u32 = 192u32;
19527 const NAME: &'static str = "MAG_CAL_REPORT";
19528 const EXTRA_CRC: u8 = 36u8;
19529 const ENCODED_LEN: usize = 54usize;
19530 fn deser(
19531 _version: MavlinkVersion,
19532 __input: &[u8],
19533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19534 let avail_len = __input.len();
19535 let mut payload_buf = [0; Self::ENCODED_LEN];
19536 let mut buf = if avail_len < Self::ENCODED_LEN {
19537 payload_buf[0..avail_len].copy_from_slice(__input);
19538 Bytes::new(&payload_buf)
19539 } else {
19540 Bytes::new(__input)
19541 };
19542 let mut __struct = Self::default();
19543 __struct.fitness = buf.get_f32_le()?;
19544 __struct.ofs_x = buf.get_f32_le()?;
19545 __struct.ofs_y = buf.get_f32_le()?;
19546 __struct.ofs_z = buf.get_f32_le()?;
19547 __struct.diag_x = buf.get_f32_le()?;
19548 __struct.diag_y = buf.get_f32_le()?;
19549 __struct.diag_z = buf.get_f32_le()?;
19550 __struct.offdiag_x = buf.get_f32_le()?;
19551 __struct.offdiag_y = buf.get_f32_le()?;
19552 __struct.offdiag_z = buf.get_f32_le()?;
19553 __struct.compass_id = buf.get_u8()?;
19554 __struct.cal_mask = buf.get_u8()?;
19555 let tmp = buf.get_u8()?;
19556 __struct.cal_status =
19557 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19558 enum_type: "MagCalStatus",
19559 value: tmp as u64,
19560 })?;
19561 __struct.autosaved = buf.get_u8()?;
19562 __struct.orientation_confidence = buf.get_f32_le()?;
19563 let tmp = buf.get_u8()?;
19564 __struct.old_orientation =
19565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19566 enum_type: "MavSensorOrientation",
19567 value: tmp as u64,
19568 })?;
19569 let tmp = buf.get_u8()?;
19570 __struct.new_orientation =
19571 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19572 enum_type: "MavSensorOrientation",
19573 value: tmp as u64,
19574 })?;
19575 __struct.scale_factor = buf.get_f32_le()?;
19576 Ok(__struct)
19577 }
19578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19579 let mut __tmp = BytesMut::new(bytes);
19580 #[allow(clippy::absurd_extreme_comparisons)]
19581 #[allow(unused_comparisons)]
19582 if __tmp.remaining() < Self::ENCODED_LEN {
19583 panic!(
19584 "buffer is too small (need {} bytes, but got {})",
19585 Self::ENCODED_LEN,
19586 __tmp.remaining(),
19587 )
19588 }
19589 __tmp.put_f32_le(self.fitness);
19590 __tmp.put_f32_le(self.ofs_x);
19591 __tmp.put_f32_le(self.ofs_y);
19592 __tmp.put_f32_le(self.ofs_z);
19593 __tmp.put_f32_le(self.diag_x);
19594 __tmp.put_f32_le(self.diag_y);
19595 __tmp.put_f32_le(self.diag_z);
19596 __tmp.put_f32_le(self.offdiag_x);
19597 __tmp.put_f32_le(self.offdiag_y);
19598 __tmp.put_f32_le(self.offdiag_z);
19599 __tmp.put_u8(self.compass_id);
19600 __tmp.put_u8(self.cal_mask);
19601 __tmp.put_u8(self.cal_status as u8);
19602 __tmp.put_u8(self.autosaved);
19603 if matches!(version, MavlinkVersion::V2) {
19604 __tmp.put_f32_le(self.orientation_confidence);
19605 __tmp.put_u8(self.old_orientation as u8);
19606 __tmp.put_u8(self.new_orientation as u8);
19607 __tmp.put_f32_le(self.scale_factor);
19608 let len = __tmp.len();
19609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19610 } else {
19611 __tmp.len()
19612 }
19613 }
19614}
19615#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19616#[doc = ""]
19617#[doc = "ID: 69"]
19618#[derive(Debug, Clone, PartialEq)]
19619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19621#[cfg_attr(feature = "ts", derive(TS))]
19622#[cfg_attr(feature = "ts", ts(export))]
19623pub struct MANUAL_CONTROL_DATA {
19624 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19625 pub x: i16,
19626 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19627 pub y: i16,
19628 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19629 pub z: i16,
19630 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19631 pub r: i16,
19632 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19633 pub buttons: u16,
19634 #[doc = "The system to be controlled."]
19635 pub target: u8,
19636 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19637 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19638 pub buttons2: u16,
19639 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19640 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19641 pub enabled_extensions: u8,
19642 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19643 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19644 pub s: i16,
19645 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19647 pub t: i16,
19648 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19650 pub aux1: i16,
19651 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19653 pub aux2: i16,
19654 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19656 pub aux3: i16,
19657 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19659 pub aux4: i16,
19660 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19662 pub aux5: i16,
19663 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19665 pub aux6: i16,
19666}
19667impl MANUAL_CONTROL_DATA {
19668 pub const ENCODED_LEN: usize = 30usize;
19669 pub const DEFAULT: Self = Self {
19670 x: 0_i16,
19671 y: 0_i16,
19672 z: 0_i16,
19673 r: 0_i16,
19674 buttons: 0_u16,
19675 target: 0_u8,
19676 buttons2: 0_u16,
19677 enabled_extensions: 0_u8,
19678 s: 0_i16,
19679 t: 0_i16,
19680 aux1: 0_i16,
19681 aux2: 0_i16,
19682 aux3: 0_i16,
19683 aux4: 0_i16,
19684 aux5: 0_i16,
19685 aux6: 0_i16,
19686 };
19687 #[cfg(feature = "arbitrary")]
19688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19689 use arbitrary::{Arbitrary, Unstructured};
19690 let mut buf = [0u8; 1024];
19691 rng.fill_bytes(&mut buf);
19692 let mut unstructured = Unstructured::new(&buf);
19693 Self::arbitrary(&mut unstructured).unwrap_or_default()
19694 }
19695}
19696impl Default for MANUAL_CONTROL_DATA {
19697 fn default() -> Self {
19698 Self::DEFAULT.clone()
19699 }
19700}
19701impl MessageData for MANUAL_CONTROL_DATA {
19702 type Message = MavMessage;
19703 const ID: u32 = 69u32;
19704 const NAME: &'static str = "MANUAL_CONTROL";
19705 const EXTRA_CRC: u8 = 243u8;
19706 const ENCODED_LEN: usize = 30usize;
19707 fn deser(
19708 _version: MavlinkVersion,
19709 __input: &[u8],
19710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19711 let avail_len = __input.len();
19712 let mut payload_buf = [0; Self::ENCODED_LEN];
19713 let mut buf = if avail_len < Self::ENCODED_LEN {
19714 payload_buf[0..avail_len].copy_from_slice(__input);
19715 Bytes::new(&payload_buf)
19716 } else {
19717 Bytes::new(__input)
19718 };
19719 let mut __struct = Self::default();
19720 __struct.x = buf.get_i16_le()?;
19721 __struct.y = buf.get_i16_le()?;
19722 __struct.z = buf.get_i16_le()?;
19723 __struct.r = buf.get_i16_le()?;
19724 __struct.buttons = buf.get_u16_le()?;
19725 __struct.target = buf.get_u8()?;
19726 __struct.buttons2 = buf.get_u16_le()?;
19727 __struct.enabled_extensions = buf.get_u8()?;
19728 __struct.s = buf.get_i16_le()?;
19729 __struct.t = buf.get_i16_le()?;
19730 __struct.aux1 = buf.get_i16_le()?;
19731 __struct.aux2 = buf.get_i16_le()?;
19732 __struct.aux3 = buf.get_i16_le()?;
19733 __struct.aux4 = buf.get_i16_le()?;
19734 __struct.aux5 = buf.get_i16_le()?;
19735 __struct.aux6 = buf.get_i16_le()?;
19736 Ok(__struct)
19737 }
19738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19739 let mut __tmp = BytesMut::new(bytes);
19740 #[allow(clippy::absurd_extreme_comparisons)]
19741 #[allow(unused_comparisons)]
19742 if __tmp.remaining() < Self::ENCODED_LEN {
19743 panic!(
19744 "buffer is too small (need {} bytes, but got {})",
19745 Self::ENCODED_LEN,
19746 __tmp.remaining(),
19747 )
19748 }
19749 __tmp.put_i16_le(self.x);
19750 __tmp.put_i16_le(self.y);
19751 __tmp.put_i16_le(self.z);
19752 __tmp.put_i16_le(self.r);
19753 __tmp.put_u16_le(self.buttons);
19754 __tmp.put_u8(self.target);
19755 if matches!(version, MavlinkVersion::V2) {
19756 __tmp.put_u16_le(self.buttons2);
19757 __tmp.put_u8(self.enabled_extensions);
19758 __tmp.put_i16_le(self.s);
19759 __tmp.put_i16_le(self.t);
19760 __tmp.put_i16_le(self.aux1);
19761 __tmp.put_i16_le(self.aux2);
19762 __tmp.put_i16_le(self.aux3);
19763 __tmp.put_i16_le(self.aux4);
19764 __tmp.put_i16_le(self.aux5);
19765 __tmp.put_i16_le(self.aux6);
19766 let len = __tmp.len();
19767 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19768 } else {
19769 __tmp.len()
19770 }
19771 }
19772}
19773#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19774#[doc = ""]
19775#[doc = "ID: 81"]
19776#[derive(Debug, Clone, PartialEq)]
19777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19778#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19779#[cfg_attr(feature = "ts", derive(TS))]
19780#[cfg_attr(feature = "ts", ts(export))]
19781pub struct MANUAL_SETPOINT_DATA {
19782 #[doc = "Timestamp (time since system boot)."]
19783 pub time_boot_ms: u32,
19784 #[doc = "Desired roll rate"]
19785 pub roll: f32,
19786 #[doc = "Desired pitch rate"]
19787 pub pitch: f32,
19788 #[doc = "Desired yaw rate"]
19789 pub yaw: f32,
19790 #[doc = "Collective thrust, normalized to 0 .. 1"]
19791 pub thrust: f32,
19792 #[doc = "Flight mode switch position, 0.. 255"]
19793 pub mode_switch: u8,
19794 #[doc = "Override mode switch position, 0.. 255"]
19795 pub manual_override_switch: u8,
19796}
19797impl MANUAL_SETPOINT_DATA {
19798 pub const ENCODED_LEN: usize = 22usize;
19799 pub const DEFAULT: Self = Self {
19800 time_boot_ms: 0_u32,
19801 roll: 0.0_f32,
19802 pitch: 0.0_f32,
19803 yaw: 0.0_f32,
19804 thrust: 0.0_f32,
19805 mode_switch: 0_u8,
19806 manual_override_switch: 0_u8,
19807 };
19808 #[cfg(feature = "arbitrary")]
19809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19810 use arbitrary::{Arbitrary, Unstructured};
19811 let mut buf = [0u8; 1024];
19812 rng.fill_bytes(&mut buf);
19813 let mut unstructured = Unstructured::new(&buf);
19814 Self::arbitrary(&mut unstructured).unwrap_or_default()
19815 }
19816}
19817impl Default for MANUAL_SETPOINT_DATA {
19818 fn default() -> Self {
19819 Self::DEFAULT.clone()
19820 }
19821}
19822impl MessageData for MANUAL_SETPOINT_DATA {
19823 type Message = MavMessage;
19824 const ID: u32 = 81u32;
19825 const NAME: &'static str = "MANUAL_SETPOINT";
19826 const EXTRA_CRC: u8 = 106u8;
19827 const ENCODED_LEN: usize = 22usize;
19828 fn deser(
19829 _version: MavlinkVersion,
19830 __input: &[u8],
19831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19832 let avail_len = __input.len();
19833 let mut payload_buf = [0; Self::ENCODED_LEN];
19834 let mut buf = if avail_len < Self::ENCODED_LEN {
19835 payload_buf[0..avail_len].copy_from_slice(__input);
19836 Bytes::new(&payload_buf)
19837 } else {
19838 Bytes::new(__input)
19839 };
19840 let mut __struct = Self::default();
19841 __struct.time_boot_ms = buf.get_u32_le()?;
19842 __struct.roll = buf.get_f32_le()?;
19843 __struct.pitch = buf.get_f32_le()?;
19844 __struct.yaw = buf.get_f32_le()?;
19845 __struct.thrust = buf.get_f32_le()?;
19846 __struct.mode_switch = buf.get_u8()?;
19847 __struct.manual_override_switch = buf.get_u8()?;
19848 Ok(__struct)
19849 }
19850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19851 let mut __tmp = BytesMut::new(bytes);
19852 #[allow(clippy::absurd_extreme_comparisons)]
19853 #[allow(unused_comparisons)]
19854 if __tmp.remaining() < Self::ENCODED_LEN {
19855 panic!(
19856 "buffer is too small (need {} bytes, but got {})",
19857 Self::ENCODED_LEN,
19858 __tmp.remaining(),
19859 )
19860 }
19861 __tmp.put_u32_le(self.time_boot_ms);
19862 __tmp.put_f32_le(self.roll);
19863 __tmp.put_f32_le(self.pitch);
19864 __tmp.put_f32_le(self.yaw);
19865 __tmp.put_f32_le(self.thrust);
19866 __tmp.put_u8(self.mode_switch);
19867 __tmp.put_u8(self.manual_override_switch);
19868 if matches!(version, MavlinkVersion::V2) {
19869 let len = __tmp.len();
19870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19871 } else {
19872 __tmp.len()
19873 }
19874 }
19875}
19876#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19877#[doc = ""]
19878#[doc = "ID: 249"]
19879#[derive(Debug, Clone, PartialEq)]
19880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19882#[cfg_attr(feature = "ts", derive(TS))]
19883#[cfg_attr(feature = "ts", ts(export))]
19884pub struct MEMORY_VECT_DATA {
19885 #[doc = "Starting address of the debug variables"]
19886 pub address: u16,
19887 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19888 pub ver: u8,
19889 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19890 pub mavtype: u8,
19891 #[doc = "Memory contents at specified address"]
19892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19893 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19894 pub value: [i8; 32],
19895}
19896impl MEMORY_VECT_DATA {
19897 pub const ENCODED_LEN: usize = 36usize;
19898 pub const DEFAULT: Self = Self {
19899 address: 0_u16,
19900 ver: 0_u8,
19901 mavtype: 0_u8,
19902 value: [0_i8; 32usize],
19903 };
19904 #[cfg(feature = "arbitrary")]
19905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19906 use arbitrary::{Arbitrary, Unstructured};
19907 let mut buf = [0u8; 1024];
19908 rng.fill_bytes(&mut buf);
19909 let mut unstructured = Unstructured::new(&buf);
19910 Self::arbitrary(&mut unstructured).unwrap_or_default()
19911 }
19912}
19913impl Default for MEMORY_VECT_DATA {
19914 fn default() -> Self {
19915 Self::DEFAULT.clone()
19916 }
19917}
19918impl MessageData for MEMORY_VECT_DATA {
19919 type Message = MavMessage;
19920 const ID: u32 = 249u32;
19921 const NAME: &'static str = "MEMORY_VECT";
19922 const EXTRA_CRC: u8 = 204u8;
19923 const ENCODED_LEN: usize = 36usize;
19924 fn deser(
19925 _version: MavlinkVersion,
19926 __input: &[u8],
19927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19928 let avail_len = __input.len();
19929 let mut payload_buf = [0; Self::ENCODED_LEN];
19930 let mut buf = if avail_len < Self::ENCODED_LEN {
19931 payload_buf[0..avail_len].copy_from_slice(__input);
19932 Bytes::new(&payload_buf)
19933 } else {
19934 Bytes::new(__input)
19935 };
19936 let mut __struct = Self::default();
19937 __struct.address = buf.get_u16_le()?;
19938 __struct.ver = buf.get_u8()?;
19939 __struct.mavtype = buf.get_u8()?;
19940 for v in &mut __struct.value {
19941 let val = buf.get_i8()?;
19942 *v = val;
19943 }
19944 Ok(__struct)
19945 }
19946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19947 let mut __tmp = BytesMut::new(bytes);
19948 #[allow(clippy::absurd_extreme_comparisons)]
19949 #[allow(unused_comparisons)]
19950 if __tmp.remaining() < Self::ENCODED_LEN {
19951 panic!(
19952 "buffer is too small (need {} bytes, but got {})",
19953 Self::ENCODED_LEN,
19954 __tmp.remaining(),
19955 )
19956 }
19957 __tmp.put_u16_le(self.address);
19958 __tmp.put_u8(self.ver);
19959 __tmp.put_u8(self.mavtype);
19960 for val in &self.value {
19961 __tmp.put_i8(*val);
19962 }
19963 if matches!(version, MavlinkVersion::V2) {
19964 let len = __tmp.len();
19965 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19966 } else {
19967 __tmp.len()
19968 }
19969 }
19970}
19971#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19972#[doc = ""]
19973#[doc = "ID: 244"]
19974#[derive(Debug, Clone, PartialEq)]
19975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19977#[cfg_attr(feature = "ts", derive(TS))]
19978#[cfg_attr(feature = "ts", ts(export))]
19979pub struct MESSAGE_INTERVAL_DATA {
19980 #[doc = "0 indicates the interval at which it is sent."]
19981 pub interval_us: i32,
19982 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19983 pub message_id: u16,
19984}
19985impl MESSAGE_INTERVAL_DATA {
19986 pub const ENCODED_LEN: usize = 6usize;
19987 pub const DEFAULT: Self = Self {
19988 interval_us: 0_i32,
19989 message_id: 0_u16,
19990 };
19991 #[cfg(feature = "arbitrary")]
19992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19993 use arbitrary::{Arbitrary, Unstructured};
19994 let mut buf = [0u8; 1024];
19995 rng.fill_bytes(&mut buf);
19996 let mut unstructured = Unstructured::new(&buf);
19997 Self::arbitrary(&mut unstructured).unwrap_or_default()
19998 }
19999}
20000impl Default for MESSAGE_INTERVAL_DATA {
20001 fn default() -> Self {
20002 Self::DEFAULT.clone()
20003 }
20004}
20005impl MessageData for MESSAGE_INTERVAL_DATA {
20006 type Message = MavMessage;
20007 const ID: u32 = 244u32;
20008 const NAME: &'static str = "MESSAGE_INTERVAL";
20009 const EXTRA_CRC: u8 = 95u8;
20010 const ENCODED_LEN: usize = 6usize;
20011 fn deser(
20012 _version: MavlinkVersion,
20013 __input: &[u8],
20014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20015 let avail_len = __input.len();
20016 let mut payload_buf = [0; Self::ENCODED_LEN];
20017 let mut buf = if avail_len < Self::ENCODED_LEN {
20018 payload_buf[0..avail_len].copy_from_slice(__input);
20019 Bytes::new(&payload_buf)
20020 } else {
20021 Bytes::new(__input)
20022 };
20023 let mut __struct = Self::default();
20024 __struct.interval_us = buf.get_i32_le()?;
20025 __struct.message_id = buf.get_u16_le()?;
20026 Ok(__struct)
20027 }
20028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20029 let mut __tmp = BytesMut::new(bytes);
20030 #[allow(clippy::absurd_extreme_comparisons)]
20031 #[allow(unused_comparisons)]
20032 if __tmp.remaining() < Self::ENCODED_LEN {
20033 panic!(
20034 "buffer is too small (need {} bytes, but got {})",
20035 Self::ENCODED_LEN,
20036 __tmp.remaining(),
20037 )
20038 }
20039 __tmp.put_i32_le(self.interval_us);
20040 __tmp.put_u16_le(self.message_id);
20041 if matches!(version, MavlinkVersion::V2) {
20042 let len = __tmp.len();
20043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20044 } else {
20045 __tmp.len()
20046 }
20047 }
20048}
20049#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20050#[doc = ""]
20051#[doc = "ID: 47"]
20052#[derive(Debug, Clone, PartialEq)]
20053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20055#[cfg_attr(feature = "ts", derive(TS))]
20056#[cfg_attr(feature = "ts", ts(export))]
20057pub struct MISSION_ACK_DATA {
20058 #[doc = "System ID"]
20059 pub target_system: u8,
20060 #[doc = "Component ID"]
20061 pub target_component: u8,
20062 #[doc = "Mission result."]
20063 pub mavtype: MavMissionResult,
20064 #[doc = "Mission type."]
20065 #[cfg_attr(feature = "serde", serde(default))]
20066 pub mission_type: MavMissionType,
20067 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20068 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20069 pub opaque_id: u32,
20070}
20071impl MISSION_ACK_DATA {
20072 pub const ENCODED_LEN: usize = 8usize;
20073 pub const DEFAULT: Self = Self {
20074 target_system: 0_u8,
20075 target_component: 0_u8,
20076 mavtype: MavMissionResult::DEFAULT,
20077 mission_type: MavMissionType::DEFAULT,
20078 opaque_id: 0_u32,
20079 };
20080 #[cfg(feature = "arbitrary")]
20081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20082 use arbitrary::{Arbitrary, Unstructured};
20083 let mut buf = [0u8; 1024];
20084 rng.fill_bytes(&mut buf);
20085 let mut unstructured = Unstructured::new(&buf);
20086 Self::arbitrary(&mut unstructured).unwrap_or_default()
20087 }
20088}
20089impl Default for MISSION_ACK_DATA {
20090 fn default() -> Self {
20091 Self::DEFAULT.clone()
20092 }
20093}
20094impl MessageData for MISSION_ACK_DATA {
20095 type Message = MavMessage;
20096 const ID: u32 = 47u32;
20097 const NAME: &'static str = "MISSION_ACK";
20098 const EXTRA_CRC: u8 = 153u8;
20099 const ENCODED_LEN: usize = 8usize;
20100 fn deser(
20101 _version: MavlinkVersion,
20102 __input: &[u8],
20103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20104 let avail_len = __input.len();
20105 let mut payload_buf = [0; Self::ENCODED_LEN];
20106 let mut buf = if avail_len < Self::ENCODED_LEN {
20107 payload_buf[0..avail_len].copy_from_slice(__input);
20108 Bytes::new(&payload_buf)
20109 } else {
20110 Bytes::new(__input)
20111 };
20112 let mut __struct = Self::default();
20113 __struct.target_system = buf.get_u8()?;
20114 __struct.target_component = buf.get_u8()?;
20115 let tmp = buf.get_u8()?;
20116 __struct.mavtype =
20117 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20118 enum_type: "MavMissionResult",
20119 value: tmp as u64,
20120 })?;
20121 let tmp = buf.get_u8()?;
20122 __struct.mission_type =
20123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20124 enum_type: "MavMissionType",
20125 value: tmp as u64,
20126 })?;
20127 __struct.opaque_id = buf.get_u32_le()?;
20128 Ok(__struct)
20129 }
20130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20131 let mut __tmp = BytesMut::new(bytes);
20132 #[allow(clippy::absurd_extreme_comparisons)]
20133 #[allow(unused_comparisons)]
20134 if __tmp.remaining() < Self::ENCODED_LEN {
20135 panic!(
20136 "buffer is too small (need {} bytes, but got {})",
20137 Self::ENCODED_LEN,
20138 __tmp.remaining(),
20139 )
20140 }
20141 __tmp.put_u8(self.target_system);
20142 __tmp.put_u8(self.target_component);
20143 __tmp.put_u8(self.mavtype as u8);
20144 if matches!(version, MavlinkVersion::V2) {
20145 __tmp.put_u8(self.mission_type as u8);
20146 __tmp.put_u32_le(self.opaque_id);
20147 let len = __tmp.len();
20148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20149 } else {
20150 __tmp.len()
20151 }
20152 }
20153}
20154#[doc = "Delete all mission items at once."]
20155#[doc = ""]
20156#[doc = "ID: 45"]
20157#[derive(Debug, Clone, PartialEq)]
20158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20160#[cfg_attr(feature = "ts", derive(TS))]
20161#[cfg_attr(feature = "ts", ts(export))]
20162pub struct MISSION_CLEAR_ALL_DATA {
20163 #[doc = "System ID"]
20164 pub target_system: u8,
20165 #[doc = "Component ID"]
20166 pub target_component: u8,
20167 #[doc = "Mission type."]
20168 #[cfg_attr(feature = "serde", serde(default))]
20169 pub mission_type: MavMissionType,
20170}
20171impl MISSION_CLEAR_ALL_DATA {
20172 pub const ENCODED_LEN: usize = 3usize;
20173 pub const DEFAULT: Self = Self {
20174 target_system: 0_u8,
20175 target_component: 0_u8,
20176 mission_type: MavMissionType::DEFAULT,
20177 };
20178 #[cfg(feature = "arbitrary")]
20179 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20180 use arbitrary::{Arbitrary, Unstructured};
20181 let mut buf = [0u8; 1024];
20182 rng.fill_bytes(&mut buf);
20183 let mut unstructured = Unstructured::new(&buf);
20184 Self::arbitrary(&mut unstructured).unwrap_or_default()
20185 }
20186}
20187impl Default for MISSION_CLEAR_ALL_DATA {
20188 fn default() -> Self {
20189 Self::DEFAULT.clone()
20190 }
20191}
20192impl MessageData for MISSION_CLEAR_ALL_DATA {
20193 type Message = MavMessage;
20194 const ID: u32 = 45u32;
20195 const NAME: &'static str = "MISSION_CLEAR_ALL";
20196 const EXTRA_CRC: u8 = 232u8;
20197 const ENCODED_LEN: usize = 3usize;
20198 fn deser(
20199 _version: MavlinkVersion,
20200 __input: &[u8],
20201 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20202 let avail_len = __input.len();
20203 let mut payload_buf = [0; Self::ENCODED_LEN];
20204 let mut buf = if avail_len < Self::ENCODED_LEN {
20205 payload_buf[0..avail_len].copy_from_slice(__input);
20206 Bytes::new(&payload_buf)
20207 } else {
20208 Bytes::new(__input)
20209 };
20210 let mut __struct = Self::default();
20211 __struct.target_system = buf.get_u8()?;
20212 __struct.target_component = buf.get_u8()?;
20213 let tmp = buf.get_u8()?;
20214 __struct.mission_type =
20215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20216 enum_type: "MavMissionType",
20217 value: tmp as u64,
20218 })?;
20219 Ok(__struct)
20220 }
20221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20222 let mut __tmp = BytesMut::new(bytes);
20223 #[allow(clippy::absurd_extreme_comparisons)]
20224 #[allow(unused_comparisons)]
20225 if __tmp.remaining() < Self::ENCODED_LEN {
20226 panic!(
20227 "buffer is too small (need {} bytes, but got {})",
20228 Self::ENCODED_LEN,
20229 __tmp.remaining(),
20230 )
20231 }
20232 __tmp.put_u8(self.target_system);
20233 __tmp.put_u8(self.target_component);
20234 if matches!(version, MavlinkVersion::V2) {
20235 __tmp.put_u8(self.mission_type as u8);
20236 let len = __tmp.len();
20237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20238 } else {
20239 __tmp.len()
20240 }
20241 }
20242}
20243#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
20244#[doc = ""]
20245#[doc = "ID: 44"]
20246#[derive(Debug, Clone, PartialEq)]
20247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20249#[cfg_attr(feature = "ts", derive(TS))]
20250#[cfg_attr(feature = "ts", ts(export))]
20251pub struct MISSION_COUNT_DATA {
20252 #[doc = "Number of mission items in the sequence"]
20253 pub count: u16,
20254 #[doc = "System ID"]
20255 pub target_system: u8,
20256 #[doc = "Component ID"]
20257 pub target_component: u8,
20258 #[doc = "Mission type."]
20259 #[cfg_attr(feature = "serde", serde(default))]
20260 pub mission_type: MavMissionType,
20261 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20262 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20263 pub opaque_id: u32,
20264}
20265impl MISSION_COUNT_DATA {
20266 pub const ENCODED_LEN: usize = 9usize;
20267 pub const DEFAULT: Self = Self {
20268 count: 0_u16,
20269 target_system: 0_u8,
20270 target_component: 0_u8,
20271 mission_type: MavMissionType::DEFAULT,
20272 opaque_id: 0_u32,
20273 };
20274 #[cfg(feature = "arbitrary")]
20275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20276 use arbitrary::{Arbitrary, Unstructured};
20277 let mut buf = [0u8; 1024];
20278 rng.fill_bytes(&mut buf);
20279 let mut unstructured = Unstructured::new(&buf);
20280 Self::arbitrary(&mut unstructured).unwrap_or_default()
20281 }
20282}
20283impl Default for MISSION_COUNT_DATA {
20284 fn default() -> Self {
20285 Self::DEFAULT.clone()
20286 }
20287}
20288impl MessageData for MISSION_COUNT_DATA {
20289 type Message = MavMessage;
20290 const ID: u32 = 44u32;
20291 const NAME: &'static str = "MISSION_COUNT";
20292 const EXTRA_CRC: u8 = 221u8;
20293 const ENCODED_LEN: usize = 9usize;
20294 fn deser(
20295 _version: MavlinkVersion,
20296 __input: &[u8],
20297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20298 let avail_len = __input.len();
20299 let mut payload_buf = [0; Self::ENCODED_LEN];
20300 let mut buf = if avail_len < Self::ENCODED_LEN {
20301 payload_buf[0..avail_len].copy_from_slice(__input);
20302 Bytes::new(&payload_buf)
20303 } else {
20304 Bytes::new(__input)
20305 };
20306 let mut __struct = Self::default();
20307 __struct.count = buf.get_u16_le()?;
20308 __struct.target_system = buf.get_u8()?;
20309 __struct.target_component = buf.get_u8()?;
20310 let tmp = buf.get_u8()?;
20311 __struct.mission_type =
20312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20313 enum_type: "MavMissionType",
20314 value: tmp as u64,
20315 })?;
20316 __struct.opaque_id = buf.get_u32_le()?;
20317 Ok(__struct)
20318 }
20319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20320 let mut __tmp = BytesMut::new(bytes);
20321 #[allow(clippy::absurd_extreme_comparisons)]
20322 #[allow(unused_comparisons)]
20323 if __tmp.remaining() < Self::ENCODED_LEN {
20324 panic!(
20325 "buffer is too small (need {} bytes, but got {})",
20326 Self::ENCODED_LEN,
20327 __tmp.remaining(),
20328 )
20329 }
20330 __tmp.put_u16_le(self.count);
20331 __tmp.put_u8(self.target_system);
20332 __tmp.put_u8(self.target_component);
20333 if matches!(version, MavlinkVersion::V2) {
20334 __tmp.put_u8(self.mission_type as u8);
20335 __tmp.put_u32_le(self.opaque_id);
20336 let len = __tmp.len();
20337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20338 } else {
20339 __tmp.len()
20340 }
20341 }
20342}
20343#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20344#[doc = ""]
20345#[doc = "ID: 42"]
20346#[derive(Debug, Clone, PartialEq)]
20347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20349#[cfg_attr(feature = "ts", derive(TS))]
20350#[cfg_attr(feature = "ts", ts(export))]
20351pub struct MISSION_CURRENT_DATA {
20352 #[doc = "Sequence"]
20353 pub seq: u16,
20354 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20355 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20356 pub total: u16,
20357 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20358 #[cfg_attr(feature = "serde", serde(default))]
20359 pub mission_state: MissionState,
20360 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20361 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20362 pub mission_mode: u8,
20363 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20365 pub mission_id: u32,
20366 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20367 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20368 pub fence_id: u32,
20369 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20370 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20371 pub rally_points_id: u32,
20372}
20373impl MISSION_CURRENT_DATA {
20374 pub const ENCODED_LEN: usize = 18usize;
20375 pub const DEFAULT: Self = Self {
20376 seq: 0_u16,
20377 total: 0_u16,
20378 mission_state: MissionState::DEFAULT,
20379 mission_mode: 0_u8,
20380 mission_id: 0_u32,
20381 fence_id: 0_u32,
20382 rally_points_id: 0_u32,
20383 };
20384 #[cfg(feature = "arbitrary")]
20385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20386 use arbitrary::{Arbitrary, Unstructured};
20387 let mut buf = [0u8; 1024];
20388 rng.fill_bytes(&mut buf);
20389 let mut unstructured = Unstructured::new(&buf);
20390 Self::arbitrary(&mut unstructured).unwrap_or_default()
20391 }
20392}
20393impl Default for MISSION_CURRENT_DATA {
20394 fn default() -> Self {
20395 Self::DEFAULT.clone()
20396 }
20397}
20398impl MessageData for MISSION_CURRENT_DATA {
20399 type Message = MavMessage;
20400 const ID: u32 = 42u32;
20401 const NAME: &'static str = "MISSION_CURRENT";
20402 const EXTRA_CRC: u8 = 28u8;
20403 const ENCODED_LEN: usize = 18usize;
20404 fn deser(
20405 _version: MavlinkVersion,
20406 __input: &[u8],
20407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20408 let avail_len = __input.len();
20409 let mut payload_buf = [0; Self::ENCODED_LEN];
20410 let mut buf = if avail_len < Self::ENCODED_LEN {
20411 payload_buf[0..avail_len].copy_from_slice(__input);
20412 Bytes::new(&payload_buf)
20413 } else {
20414 Bytes::new(__input)
20415 };
20416 let mut __struct = Self::default();
20417 __struct.seq = buf.get_u16_le()?;
20418 __struct.total = buf.get_u16_le()?;
20419 let tmp = buf.get_u8()?;
20420 __struct.mission_state =
20421 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20422 enum_type: "MissionState",
20423 value: tmp as u64,
20424 })?;
20425 __struct.mission_mode = buf.get_u8()?;
20426 __struct.mission_id = buf.get_u32_le()?;
20427 __struct.fence_id = buf.get_u32_le()?;
20428 __struct.rally_points_id = buf.get_u32_le()?;
20429 Ok(__struct)
20430 }
20431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20432 let mut __tmp = BytesMut::new(bytes);
20433 #[allow(clippy::absurd_extreme_comparisons)]
20434 #[allow(unused_comparisons)]
20435 if __tmp.remaining() < Self::ENCODED_LEN {
20436 panic!(
20437 "buffer is too small (need {} bytes, but got {})",
20438 Self::ENCODED_LEN,
20439 __tmp.remaining(),
20440 )
20441 }
20442 __tmp.put_u16_le(self.seq);
20443 if matches!(version, MavlinkVersion::V2) {
20444 __tmp.put_u16_le(self.total);
20445 __tmp.put_u8(self.mission_state as u8);
20446 __tmp.put_u8(self.mission_mode);
20447 __tmp.put_u32_le(self.mission_id);
20448 __tmp.put_u32_le(self.fence_id);
20449 __tmp.put_u32_le(self.rally_points_id);
20450 let len = __tmp.len();
20451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20452 } else {
20453 __tmp.len()
20454 }
20455 }
20456}
20457#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20458#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20459#[doc = ""]
20460#[doc = "ID: 39"]
20461#[derive(Debug, Clone, PartialEq)]
20462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20464#[cfg_attr(feature = "ts", derive(TS))]
20465#[cfg_attr(feature = "ts", ts(export))]
20466pub struct MISSION_ITEM_DATA {
20467 #[doc = "PARAM1, see MAV_CMD enum"]
20468 pub param1: f32,
20469 #[doc = "PARAM2, see MAV_CMD enum"]
20470 pub param2: f32,
20471 #[doc = "PARAM3, see MAV_CMD enum"]
20472 pub param3: f32,
20473 #[doc = "PARAM4, see MAV_CMD enum"]
20474 pub param4: f32,
20475 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20476 pub x: f32,
20477 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20478 pub y: f32,
20479 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20480 pub z: f32,
20481 #[doc = "Sequence"]
20482 pub seq: u16,
20483 #[doc = "The scheduled action for the waypoint."]
20484 pub command: MavCmd,
20485 #[doc = "System ID"]
20486 pub target_system: u8,
20487 #[doc = "Component ID"]
20488 pub target_component: u8,
20489 #[doc = "The coordinate system of the waypoint."]
20490 pub frame: MavFrame,
20491 #[doc = "false:0, true:1"]
20492 pub current: u8,
20493 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20494 pub autocontinue: u8,
20495 #[doc = "Mission type."]
20496 #[cfg_attr(feature = "serde", serde(default))]
20497 pub mission_type: MavMissionType,
20498}
20499impl MISSION_ITEM_DATA {
20500 pub const ENCODED_LEN: usize = 38usize;
20501 pub const DEFAULT: Self = Self {
20502 param1: 0.0_f32,
20503 param2: 0.0_f32,
20504 param3: 0.0_f32,
20505 param4: 0.0_f32,
20506 x: 0.0_f32,
20507 y: 0.0_f32,
20508 z: 0.0_f32,
20509 seq: 0_u16,
20510 command: MavCmd::DEFAULT,
20511 target_system: 0_u8,
20512 target_component: 0_u8,
20513 frame: MavFrame::DEFAULT,
20514 current: 0_u8,
20515 autocontinue: 0_u8,
20516 mission_type: MavMissionType::DEFAULT,
20517 };
20518 #[cfg(feature = "arbitrary")]
20519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20520 use arbitrary::{Arbitrary, Unstructured};
20521 let mut buf = [0u8; 1024];
20522 rng.fill_bytes(&mut buf);
20523 let mut unstructured = Unstructured::new(&buf);
20524 Self::arbitrary(&mut unstructured).unwrap_or_default()
20525 }
20526}
20527impl Default for MISSION_ITEM_DATA {
20528 fn default() -> Self {
20529 Self::DEFAULT.clone()
20530 }
20531}
20532impl MessageData for MISSION_ITEM_DATA {
20533 type Message = MavMessage;
20534 const ID: u32 = 39u32;
20535 const NAME: &'static str = "MISSION_ITEM";
20536 const EXTRA_CRC: u8 = 254u8;
20537 const ENCODED_LEN: usize = 38usize;
20538 fn deser(
20539 _version: MavlinkVersion,
20540 __input: &[u8],
20541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20542 let avail_len = __input.len();
20543 let mut payload_buf = [0; Self::ENCODED_LEN];
20544 let mut buf = if avail_len < Self::ENCODED_LEN {
20545 payload_buf[0..avail_len].copy_from_slice(__input);
20546 Bytes::new(&payload_buf)
20547 } else {
20548 Bytes::new(__input)
20549 };
20550 let mut __struct = Self::default();
20551 __struct.param1 = buf.get_f32_le()?;
20552 __struct.param2 = buf.get_f32_le()?;
20553 __struct.param3 = buf.get_f32_le()?;
20554 __struct.param4 = buf.get_f32_le()?;
20555 __struct.x = buf.get_f32_le()?;
20556 __struct.y = buf.get_f32_le()?;
20557 __struct.z = buf.get_f32_le()?;
20558 __struct.seq = buf.get_u16_le()?;
20559 let tmp = buf.get_u16_le()?;
20560 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20561 ::mavlink_core::error::ParserError::InvalidEnum {
20562 enum_type: "MavCmd",
20563 value: tmp as u64,
20564 },
20565 )?;
20566 __struct.target_system = buf.get_u8()?;
20567 __struct.target_component = buf.get_u8()?;
20568 let tmp = buf.get_u8()?;
20569 __struct.frame =
20570 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20571 enum_type: "MavFrame",
20572 value: tmp as u64,
20573 })?;
20574 __struct.current = buf.get_u8()?;
20575 __struct.autocontinue = buf.get_u8()?;
20576 let tmp = buf.get_u8()?;
20577 __struct.mission_type =
20578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20579 enum_type: "MavMissionType",
20580 value: tmp as u64,
20581 })?;
20582 Ok(__struct)
20583 }
20584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20585 let mut __tmp = BytesMut::new(bytes);
20586 #[allow(clippy::absurd_extreme_comparisons)]
20587 #[allow(unused_comparisons)]
20588 if __tmp.remaining() < Self::ENCODED_LEN {
20589 panic!(
20590 "buffer is too small (need {} bytes, but got {})",
20591 Self::ENCODED_LEN,
20592 __tmp.remaining(),
20593 )
20594 }
20595 __tmp.put_f32_le(self.param1);
20596 __tmp.put_f32_le(self.param2);
20597 __tmp.put_f32_le(self.param3);
20598 __tmp.put_f32_le(self.param4);
20599 __tmp.put_f32_le(self.x);
20600 __tmp.put_f32_le(self.y);
20601 __tmp.put_f32_le(self.z);
20602 __tmp.put_u16_le(self.seq);
20603 __tmp.put_u16_le(self.command as u16);
20604 __tmp.put_u8(self.target_system);
20605 __tmp.put_u8(self.target_component);
20606 __tmp.put_u8(self.frame as u8);
20607 __tmp.put_u8(self.current);
20608 __tmp.put_u8(self.autocontinue);
20609 if matches!(version, MavlinkVersion::V2) {
20610 __tmp.put_u8(self.mission_type as u8);
20611 let len = __tmp.len();
20612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20613 } else {
20614 __tmp.len()
20615 }
20616 }
20617}
20618#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20619#[doc = ""]
20620#[doc = "ID: 73"]
20621#[derive(Debug, Clone, PartialEq)]
20622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20624#[cfg_attr(feature = "ts", derive(TS))]
20625#[cfg_attr(feature = "ts", ts(export))]
20626pub struct MISSION_ITEM_INT_DATA {
20627 #[doc = "PARAM1, see MAV_CMD enum"]
20628 pub param1: f32,
20629 #[doc = "PARAM2, see MAV_CMD enum"]
20630 pub param2: f32,
20631 #[doc = "PARAM3, see MAV_CMD enum"]
20632 pub param3: f32,
20633 #[doc = "PARAM4, see MAV_CMD enum"]
20634 pub param4: f32,
20635 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20636 pub x: i32,
20637 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20638 pub y: i32,
20639 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20640 pub z: f32,
20641 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20642 pub seq: u16,
20643 #[doc = "The scheduled action for the waypoint."]
20644 pub command: MavCmd,
20645 #[doc = "System ID"]
20646 pub target_system: u8,
20647 #[doc = "Component ID"]
20648 pub target_component: u8,
20649 #[doc = "The coordinate system of the waypoint."]
20650 pub frame: MavFrame,
20651 #[doc = "false:0, true:1"]
20652 pub current: u8,
20653 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20654 pub autocontinue: u8,
20655 #[doc = "Mission type."]
20656 #[cfg_attr(feature = "serde", serde(default))]
20657 pub mission_type: MavMissionType,
20658}
20659impl MISSION_ITEM_INT_DATA {
20660 pub const ENCODED_LEN: usize = 38usize;
20661 pub const DEFAULT: Self = Self {
20662 param1: 0.0_f32,
20663 param2: 0.0_f32,
20664 param3: 0.0_f32,
20665 param4: 0.0_f32,
20666 x: 0_i32,
20667 y: 0_i32,
20668 z: 0.0_f32,
20669 seq: 0_u16,
20670 command: MavCmd::DEFAULT,
20671 target_system: 0_u8,
20672 target_component: 0_u8,
20673 frame: MavFrame::DEFAULT,
20674 current: 0_u8,
20675 autocontinue: 0_u8,
20676 mission_type: MavMissionType::DEFAULT,
20677 };
20678 #[cfg(feature = "arbitrary")]
20679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20680 use arbitrary::{Arbitrary, Unstructured};
20681 let mut buf = [0u8; 1024];
20682 rng.fill_bytes(&mut buf);
20683 let mut unstructured = Unstructured::new(&buf);
20684 Self::arbitrary(&mut unstructured).unwrap_or_default()
20685 }
20686}
20687impl Default for MISSION_ITEM_INT_DATA {
20688 fn default() -> Self {
20689 Self::DEFAULT.clone()
20690 }
20691}
20692impl MessageData for MISSION_ITEM_INT_DATA {
20693 type Message = MavMessage;
20694 const ID: u32 = 73u32;
20695 const NAME: &'static str = "MISSION_ITEM_INT";
20696 const EXTRA_CRC: u8 = 38u8;
20697 const ENCODED_LEN: usize = 38usize;
20698 fn deser(
20699 _version: MavlinkVersion,
20700 __input: &[u8],
20701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20702 let avail_len = __input.len();
20703 let mut payload_buf = [0; Self::ENCODED_LEN];
20704 let mut buf = if avail_len < Self::ENCODED_LEN {
20705 payload_buf[0..avail_len].copy_from_slice(__input);
20706 Bytes::new(&payload_buf)
20707 } else {
20708 Bytes::new(__input)
20709 };
20710 let mut __struct = Self::default();
20711 __struct.param1 = buf.get_f32_le()?;
20712 __struct.param2 = buf.get_f32_le()?;
20713 __struct.param3 = buf.get_f32_le()?;
20714 __struct.param4 = buf.get_f32_le()?;
20715 __struct.x = buf.get_i32_le()?;
20716 __struct.y = buf.get_i32_le()?;
20717 __struct.z = buf.get_f32_le()?;
20718 __struct.seq = buf.get_u16_le()?;
20719 let tmp = buf.get_u16_le()?;
20720 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20721 ::mavlink_core::error::ParserError::InvalidEnum {
20722 enum_type: "MavCmd",
20723 value: tmp as u64,
20724 },
20725 )?;
20726 __struct.target_system = buf.get_u8()?;
20727 __struct.target_component = buf.get_u8()?;
20728 let tmp = buf.get_u8()?;
20729 __struct.frame =
20730 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20731 enum_type: "MavFrame",
20732 value: tmp as u64,
20733 })?;
20734 __struct.current = buf.get_u8()?;
20735 __struct.autocontinue = buf.get_u8()?;
20736 let tmp = buf.get_u8()?;
20737 __struct.mission_type =
20738 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20739 enum_type: "MavMissionType",
20740 value: tmp as u64,
20741 })?;
20742 Ok(__struct)
20743 }
20744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20745 let mut __tmp = BytesMut::new(bytes);
20746 #[allow(clippy::absurd_extreme_comparisons)]
20747 #[allow(unused_comparisons)]
20748 if __tmp.remaining() < Self::ENCODED_LEN {
20749 panic!(
20750 "buffer is too small (need {} bytes, but got {})",
20751 Self::ENCODED_LEN,
20752 __tmp.remaining(),
20753 )
20754 }
20755 __tmp.put_f32_le(self.param1);
20756 __tmp.put_f32_le(self.param2);
20757 __tmp.put_f32_le(self.param3);
20758 __tmp.put_f32_le(self.param4);
20759 __tmp.put_i32_le(self.x);
20760 __tmp.put_i32_le(self.y);
20761 __tmp.put_f32_le(self.z);
20762 __tmp.put_u16_le(self.seq);
20763 __tmp.put_u16_le(self.command as u16);
20764 __tmp.put_u8(self.target_system);
20765 __tmp.put_u8(self.target_component);
20766 __tmp.put_u8(self.frame as u8);
20767 __tmp.put_u8(self.current);
20768 __tmp.put_u8(self.autocontinue);
20769 if matches!(version, MavlinkVersion::V2) {
20770 __tmp.put_u8(self.mission_type as u8);
20771 let len = __tmp.len();
20772 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20773 } else {
20774 __tmp.len()
20775 }
20776 }
20777}
20778#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20779#[doc = ""]
20780#[doc = "ID: 46"]
20781#[derive(Debug, Clone, PartialEq)]
20782#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20783#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20784#[cfg_attr(feature = "ts", derive(TS))]
20785#[cfg_attr(feature = "ts", ts(export))]
20786pub struct MISSION_ITEM_REACHED_DATA {
20787 #[doc = "Sequence"]
20788 pub seq: u16,
20789}
20790impl MISSION_ITEM_REACHED_DATA {
20791 pub const ENCODED_LEN: usize = 2usize;
20792 pub const DEFAULT: Self = Self { seq: 0_u16 };
20793 #[cfg(feature = "arbitrary")]
20794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20795 use arbitrary::{Arbitrary, Unstructured};
20796 let mut buf = [0u8; 1024];
20797 rng.fill_bytes(&mut buf);
20798 let mut unstructured = Unstructured::new(&buf);
20799 Self::arbitrary(&mut unstructured).unwrap_or_default()
20800 }
20801}
20802impl Default for MISSION_ITEM_REACHED_DATA {
20803 fn default() -> Self {
20804 Self::DEFAULT.clone()
20805 }
20806}
20807impl MessageData for MISSION_ITEM_REACHED_DATA {
20808 type Message = MavMessage;
20809 const ID: u32 = 46u32;
20810 const NAME: &'static str = "MISSION_ITEM_REACHED";
20811 const EXTRA_CRC: u8 = 11u8;
20812 const ENCODED_LEN: usize = 2usize;
20813 fn deser(
20814 _version: MavlinkVersion,
20815 __input: &[u8],
20816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20817 let avail_len = __input.len();
20818 let mut payload_buf = [0; Self::ENCODED_LEN];
20819 let mut buf = if avail_len < Self::ENCODED_LEN {
20820 payload_buf[0..avail_len].copy_from_slice(__input);
20821 Bytes::new(&payload_buf)
20822 } else {
20823 Bytes::new(__input)
20824 };
20825 let mut __struct = Self::default();
20826 __struct.seq = buf.get_u16_le()?;
20827 Ok(__struct)
20828 }
20829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20830 let mut __tmp = BytesMut::new(bytes);
20831 #[allow(clippy::absurd_extreme_comparisons)]
20832 #[allow(unused_comparisons)]
20833 if __tmp.remaining() < Self::ENCODED_LEN {
20834 panic!(
20835 "buffer is too small (need {} bytes, but got {})",
20836 Self::ENCODED_LEN,
20837 __tmp.remaining(),
20838 )
20839 }
20840 __tmp.put_u16_le(self.seq);
20841 if matches!(version, MavlinkVersion::V2) {
20842 let len = __tmp.len();
20843 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20844 } else {
20845 __tmp.len()
20846 }
20847 }
20848}
20849#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20850#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20851#[doc = ""]
20852#[doc = "ID: 40"]
20853#[derive(Debug, Clone, PartialEq)]
20854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20856#[cfg_attr(feature = "ts", derive(TS))]
20857#[cfg_attr(feature = "ts", ts(export))]
20858pub struct MISSION_REQUEST_DATA {
20859 #[doc = "Sequence"]
20860 pub seq: u16,
20861 #[doc = "System ID"]
20862 pub target_system: u8,
20863 #[doc = "Component ID"]
20864 pub target_component: u8,
20865 #[doc = "Mission type."]
20866 #[cfg_attr(feature = "serde", serde(default))]
20867 pub mission_type: MavMissionType,
20868}
20869impl MISSION_REQUEST_DATA {
20870 pub const ENCODED_LEN: usize = 5usize;
20871 pub const DEFAULT: Self = Self {
20872 seq: 0_u16,
20873 target_system: 0_u8,
20874 target_component: 0_u8,
20875 mission_type: MavMissionType::DEFAULT,
20876 };
20877 #[cfg(feature = "arbitrary")]
20878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20879 use arbitrary::{Arbitrary, Unstructured};
20880 let mut buf = [0u8; 1024];
20881 rng.fill_bytes(&mut buf);
20882 let mut unstructured = Unstructured::new(&buf);
20883 Self::arbitrary(&mut unstructured).unwrap_or_default()
20884 }
20885}
20886impl Default for MISSION_REQUEST_DATA {
20887 fn default() -> Self {
20888 Self::DEFAULT.clone()
20889 }
20890}
20891impl MessageData for MISSION_REQUEST_DATA {
20892 type Message = MavMessage;
20893 const ID: u32 = 40u32;
20894 const NAME: &'static str = "MISSION_REQUEST";
20895 const EXTRA_CRC: u8 = 230u8;
20896 const ENCODED_LEN: usize = 5usize;
20897 fn deser(
20898 _version: MavlinkVersion,
20899 __input: &[u8],
20900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20901 let avail_len = __input.len();
20902 let mut payload_buf = [0; Self::ENCODED_LEN];
20903 let mut buf = if avail_len < Self::ENCODED_LEN {
20904 payload_buf[0..avail_len].copy_from_slice(__input);
20905 Bytes::new(&payload_buf)
20906 } else {
20907 Bytes::new(__input)
20908 };
20909 let mut __struct = Self::default();
20910 __struct.seq = buf.get_u16_le()?;
20911 __struct.target_system = buf.get_u8()?;
20912 __struct.target_component = buf.get_u8()?;
20913 let tmp = buf.get_u8()?;
20914 __struct.mission_type =
20915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20916 enum_type: "MavMissionType",
20917 value: tmp as u64,
20918 })?;
20919 Ok(__struct)
20920 }
20921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20922 let mut __tmp = BytesMut::new(bytes);
20923 #[allow(clippy::absurd_extreme_comparisons)]
20924 #[allow(unused_comparisons)]
20925 if __tmp.remaining() < Self::ENCODED_LEN {
20926 panic!(
20927 "buffer is too small (need {} bytes, but got {})",
20928 Self::ENCODED_LEN,
20929 __tmp.remaining(),
20930 )
20931 }
20932 __tmp.put_u16_le(self.seq);
20933 __tmp.put_u8(self.target_system);
20934 __tmp.put_u8(self.target_component);
20935 if matches!(version, MavlinkVersion::V2) {
20936 __tmp.put_u8(self.mission_type as u8);
20937 let len = __tmp.len();
20938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20939 } else {
20940 __tmp.len()
20941 }
20942 }
20943}
20944#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20945#[doc = ""]
20946#[doc = "ID: 51"]
20947#[derive(Debug, Clone, PartialEq)]
20948#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20949#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20950#[cfg_attr(feature = "ts", derive(TS))]
20951#[cfg_attr(feature = "ts", ts(export))]
20952pub struct MISSION_REQUEST_INT_DATA {
20953 #[doc = "Sequence"]
20954 pub seq: u16,
20955 #[doc = "System ID"]
20956 pub target_system: u8,
20957 #[doc = "Component ID"]
20958 pub target_component: u8,
20959 #[doc = "Mission type."]
20960 #[cfg_attr(feature = "serde", serde(default))]
20961 pub mission_type: MavMissionType,
20962}
20963impl MISSION_REQUEST_INT_DATA {
20964 pub const ENCODED_LEN: usize = 5usize;
20965 pub const DEFAULT: Self = Self {
20966 seq: 0_u16,
20967 target_system: 0_u8,
20968 target_component: 0_u8,
20969 mission_type: MavMissionType::DEFAULT,
20970 };
20971 #[cfg(feature = "arbitrary")]
20972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20973 use arbitrary::{Arbitrary, Unstructured};
20974 let mut buf = [0u8; 1024];
20975 rng.fill_bytes(&mut buf);
20976 let mut unstructured = Unstructured::new(&buf);
20977 Self::arbitrary(&mut unstructured).unwrap_or_default()
20978 }
20979}
20980impl Default for MISSION_REQUEST_INT_DATA {
20981 fn default() -> Self {
20982 Self::DEFAULT.clone()
20983 }
20984}
20985impl MessageData for MISSION_REQUEST_INT_DATA {
20986 type Message = MavMessage;
20987 const ID: u32 = 51u32;
20988 const NAME: &'static str = "MISSION_REQUEST_INT";
20989 const EXTRA_CRC: u8 = 196u8;
20990 const ENCODED_LEN: usize = 5usize;
20991 fn deser(
20992 _version: MavlinkVersion,
20993 __input: &[u8],
20994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20995 let avail_len = __input.len();
20996 let mut payload_buf = [0; Self::ENCODED_LEN];
20997 let mut buf = if avail_len < Self::ENCODED_LEN {
20998 payload_buf[0..avail_len].copy_from_slice(__input);
20999 Bytes::new(&payload_buf)
21000 } else {
21001 Bytes::new(__input)
21002 };
21003 let mut __struct = Self::default();
21004 __struct.seq = buf.get_u16_le()?;
21005 __struct.target_system = buf.get_u8()?;
21006 __struct.target_component = buf.get_u8()?;
21007 let tmp = buf.get_u8()?;
21008 __struct.mission_type =
21009 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21010 enum_type: "MavMissionType",
21011 value: tmp as u64,
21012 })?;
21013 Ok(__struct)
21014 }
21015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21016 let mut __tmp = BytesMut::new(bytes);
21017 #[allow(clippy::absurd_extreme_comparisons)]
21018 #[allow(unused_comparisons)]
21019 if __tmp.remaining() < Self::ENCODED_LEN {
21020 panic!(
21021 "buffer is too small (need {} bytes, but got {})",
21022 Self::ENCODED_LEN,
21023 __tmp.remaining(),
21024 )
21025 }
21026 __tmp.put_u16_le(self.seq);
21027 __tmp.put_u8(self.target_system);
21028 __tmp.put_u8(self.target_component);
21029 if matches!(version, MavlinkVersion::V2) {
21030 __tmp.put_u8(self.mission_type as u8);
21031 let len = __tmp.len();
21032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21033 } else {
21034 __tmp.len()
21035 }
21036 }
21037}
21038#[doc = "Request the overall list of mission items from the system/component."]
21039#[doc = ""]
21040#[doc = "ID: 43"]
21041#[derive(Debug, Clone, PartialEq)]
21042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21044#[cfg_attr(feature = "ts", derive(TS))]
21045#[cfg_attr(feature = "ts", ts(export))]
21046pub struct MISSION_REQUEST_LIST_DATA {
21047 #[doc = "System ID"]
21048 pub target_system: u8,
21049 #[doc = "Component ID"]
21050 pub target_component: u8,
21051 #[doc = "Mission type."]
21052 #[cfg_attr(feature = "serde", serde(default))]
21053 pub mission_type: MavMissionType,
21054}
21055impl MISSION_REQUEST_LIST_DATA {
21056 pub const ENCODED_LEN: usize = 3usize;
21057 pub const DEFAULT: Self = Self {
21058 target_system: 0_u8,
21059 target_component: 0_u8,
21060 mission_type: MavMissionType::DEFAULT,
21061 };
21062 #[cfg(feature = "arbitrary")]
21063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21064 use arbitrary::{Arbitrary, Unstructured};
21065 let mut buf = [0u8; 1024];
21066 rng.fill_bytes(&mut buf);
21067 let mut unstructured = Unstructured::new(&buf);
21068 Self::arbitrary(&mut unstructured).unwrap_or_default()
21069 }
21070}
21071impl Default for MISSION_REQUEST_LIST_DATA {
21072 fn default() -> Self {
21073 Self::DEFAULT.clone()
21074 }
21075}
21076impl MessageData for MISSION_REQUEST_LIST_DATA {
21077 type Message = MavMessage;
21078 const ID: u32 = 43u32;
21079 const NAME: &'static str = "MISSION_REQUEST_LIST";
21080 const EXTRA_CRC: u8 = 132u8;
21081 const ENCODED_LEN: usize = 3usize;
21082 fn deser(
21083 _version: MavlinkVersion,
21084 __input: &[u8],
21085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21086 let avail_len = __input.len();
21087 let mut payload_buf = [0; Self::ENCODED_LEN];
21088 let mut buf = if avail_len < Self::ENCODED_LEN {
21089 payload_buf[0..avail_len].copy_from_slice(__input);
21090 Bytes::new(&payload_buf)
21091 } else {
21092 Bytes::new(__input)
21093 };
21094 let mut __struct = Self::default();
21095 __struct.target_system = buf.get_u8()?;
21096 __struct.target_component = buf.get_u8()?;
21097 let tmp = buf.get_u8()?;
21098 __struct.mission_type =
21099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21100 enum_type: "MavMissionType",
21101 value: tmp as u64,
21102 })?;
21103 Ok(__struct)
21104 }
21105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21106 let mut __tmp = BytesMut::new(bytes);
21107 #[allow(clippy::absurd_extreme_comparisons)]
21108 #[allow(unused_comparisons)]
21109 if __tmp.remaining() < Self::ENCODED_LEN {
21110 panic!(
21111 "buffer is too small (need {} bytes, but got {})",
21112 Self::ENCODED_LEN,
21113 __tmp.remaining(),
21114 )
21115 }
21116 __tmp.put_u8(self.target_system);
21117 __tmp.put_u8(self.target_component);
21118 if matches!(version, MavlinkVersion::V2) {
21119 __tmp.put_u8(self.mission_type as u8);
21120 let len = __tmp.len();
21121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21122 } else {
21123 __tmp.len()
21124 }
21125 }
21126}
21127#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21128#[doc = ""]
21129#[doc = "ID: 37"]
21130#[derive(Debug, Clone, PartialEq)]
21131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21133#[cfg_attr(feature = "ts", derive(TS))]
21134#[cfg_attr(feature = "ts", ts(export))]
21135pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21136 #[doc = "Start index"]
21137 pub start_index: i16,
21138 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
21139 pub end_index: i16,
21140 #[doc = "System ID"]
21141 pub target_system: u8,
21142 #[doc = "Component ID"]
21143 pub target_component: u8,
21144 #[doc = "Mission type."]
21145 #[cfg_attr(feature = "serde", serde(default))]
21146 pub mission_type: MavMissionType,
21147}
21148impl MISSION_REQUEST_PARTIAL_LIST_DATA {
21149 pub const ENCODED_LEN: usize = 7usize;
21150 pub const DEFAULT: Self = Self {
21151 start_index: 0_i16,
21152 end_index: 0_i16,
21153 target_system: 0_u8,
21154 target_component: 0_u8,
21155 mission_type: MavMissionType::DEFAULT,
21156 };
21157 #[cfg(feature = "arbitrary")]
21158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21159 use arbitrary::{Arbitrary, Unstructured};
21160 let mut buf = [0u8; 1024];
21161 rng.fill_bytes(&mut buf);
21162 let mut unstructured = Unstructured::new(&buf);
21163 Self::arbitrary(&mut unstructured).unwrap_or_default()
21164 }
21165}
21166impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
21167 fn default() -> Self {
21168 Self::DEFAULT.clone()
21169 }
21170}
21171impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
21172 type Message = MavMessage;
21173 const ID: u32 = 37u32;
21174 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
21175 const EXTRA_CRC: u8 = 212u8;
21176 const ENCODED_LEN: usize = 7usize;
21177 fn deser(
21178 _version: MavlinkVersion,
21179 __input: &[u8],
21180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21181 let avail_len = __input.len();
21182 let mut payload_buf = [0; Self::ENCODED_LEN];
21183 let mut buf = if avail_len < Self::ENCODED_LEN {
21184 payload_buf[0..avail_len].copy_from_slice(__input);
21185 Bytes::new(&payload_buf)
21186 } else {
21187 Bytes::new(__input)
21188 };
21189 let mut __struct = Self::default();
21190 __struct.start_index = buf.get_i16_le()?;
21191 __struct.end_index = buf.get_i16_le()?;
21192 __struct.target_system = buf.get_u8()?;
21193 __struct.target_component = buf.get_u8()?;
21194 let tmp = buf.get_u8()?;
21195 __struct.mission_type =
21196 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21197 enum_type: "MavMissionType",
21198 value: tmp as u64,
21199 })?;
21200 Ok(__struct)
21201 }
21202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21203 let mut __tmp = BytesMut::new(bytes);
21204 #[allow(clippy::absurd_extreme_comparisons)]
21205 #[allow(unused_comparisons)]
21206 if __tmp.remaining() < Self::ENCODED_LEN {
21207 panic!(
21208 "buffer is too small (need {} bytes, but got {})",
21209 Self::ENCODED_LEN,
21210 __tmp.remaining(),
21211 )
21212 }
21213 __tmp.put_i16_le(self.start_index);
21214 __tmp.put_i16_le(self.end_index);
21215 __tmp.put_u8(self.target_system);
21216 __tmp.put_u8(self.target_component);
21217 if matches!(version, MavlinkVersion::V2) {
21218 __tmp.put_u8(self.mission_type as u8);
21219 let len = __tmp.len();
21220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21221 } else {
21222 __tmp.len()
21223 }
21224 }
21225}
21226#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
21227#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
21228#[doc = ""]
21229#[doc = "ID: 41"]
21230#[derive(Debug, Clone, PartialEq)]
21231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21233#[cfg_attr(feature = "ts", derive(TS))]
21234#[cfg_attr(feature = "ts", ts(export))]
21235pub struct MISSION_SET_CURRENT_DATA {
21236 #[doc = "Sequence"]
21237 pub seq: u16,
21238 #[doc = "System ID"]
21239 pub target_system: u8,
21240 #[doc = "Component ID"]
21241 pub target_component: u8,
21242}
21243impl MISSION_SET_CURRENT_DATA {
21244 pub const ENCODED_LEN: usize = 4usize;
21245 pub const DEFAULT: Self = Self {
21246 seq: 0_u16,
21247 target_system: 0_u8,
21248 target_component: 0_u8,
21249 };
21250 #[cfg(feature = "arbitrary")]
21251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21252 use arbitrary::{Arbitrary, Unstructured};
21253 let mut buf = [0u8; 1024];
21254 rng.fill_bytes(&mut buf);
21255 let mut unstructured = Unstructured::new(&buf);
21256 Self::arbitrary(&mut unstructured).unwrap_or_default()
21257 }
21258}
21259impl Default for MISSION_SET_CURRENT_DATA {
21260 fn default() -> Self {
21261 Self::DEFAULT.clone()
21262 }
21263}
21264impl MessageData for MISSION_SET_CURRENT_DATA {
21265 type Message = MavMessage;
21266 const ID: u32 = 41u32;
21267 const NAME: &'static str = "MISSION_SET_CURRENT";
21268 const EXTRA_CRC: u8 = 28u8;
21269 const ENCODED_LEN: usize = 4usize;
21270 fn deser(
21271 _version: MavlinkVersion,
21272 __input: &[u8],
21273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21274 let avail_len = __input.len();
21275 let mut payload_buf = [0; Self::ENCODED_LEN];
21276 let mut buf = if avail_len < Self::ENCODED_LEN {
21277 payload_buf[0..avail_len].copy_from_slice(__input);
21278 Bytes::new(&payload_buf)
21279 } else {
21280 Bytes::new(__input)
21281 };
21282 let mut __struct = Self::default();
21283 __struct.seq = buf.get_u16_le()?;
21284 __struct.target_system = buf.get_u8()?;
21285 __struct.target_component = buf.get_u8()?;
21286 Ok(__struct)
21287 }
21288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21289 let mut __tmp = BytesMut::new(bytes);
21290 #[allow(clippy::absurd_extreme_comparisons)]
21291 #[allow(unused_comparisons)]
21292 if __tmp.remaining() < Self::ENCODED_LEN {
21293 panic!(
21294 "buffer is too small (need {} bytes, but got {})",
21295 Self::ENCODED_LEN,
21296 __tmp.remaining(),
21297 )
21298 }
21299 __tmp.put_u16_le(self.seq);
21300 __tmp.put_u8(self.target_system);
21301 __tmp.put_u8(self.target_component);
21302 if matches!(version, MavlinkVersion::V2) {
21303 let len = __tmp.len();
21304 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21305 } else {
21306 __tmp.len()
21307 }
21308 }
21309}
21310#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21311#[doc = ""]
21312#[doc = "ID: 38"]
21313#[derive(Debug, Clone, PartialEq)]
21314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21316#[cfg_attr(feature = "ts", derive(TS))]
21317#[cfg_attr(feature = "ts", ts(export))]
21318pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21319 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21320 pub start_index: i16,
21321 #[doc = "End index, equal or greater than start index."]
21322 pub end_index: i16,
21323 #[doc = "System ID"]
21324 pub target_system: u8,
21325 #[doc = "Component ID"]
21326 pub target_component: u8,
21327 #[doc = "Mission type."]
21328 #[cfg_attr(feature = "serde", serde(default))]
21329 pub mission_type: MavMissionType,
21330}
21331impl MISSION_WRITE_PARTIAL_LIST_DATA {
21332 pub const ENCODED_LEN: usize = 7usize;
21333 pub const DEFAULT: Self = Self {
21334 start_index: 0_i16,
21335 end_index: 0_i16,
21336 target_system: 0_u8,
21337 target_component: 0_u8,
21338 mission_type: MavMissionType::DEFAULT,
21339 };
21340 #[cfg(feature = "arbitrary")]
21341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21342 use arbitrary::{Arbitrary, Unstructured};
21343 let mut buf = [0u8; 1024];
21344 rng.fill_bytes(&mut buf);
21345 let mut unstructured = Unstructured::new(&buf);
21346 Self::arbitrary(&mut unstructured).unwrap_or_default()
21347 }
21348}
21349impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21350 fn default() -> Self {
21351 Self::DEFAULT.clone()
21352 }
21353}
21354impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21355 type Message = MavMessage;
21356 const ID: u32 = 38u32;
21357 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21358 const EXTRA_CRC: u8 = 9u8;
21359 const ENCODED_LEN: usize = 7usize;
21360 fn deser(
21361 _version: MavlinkVersion,
21362 __input: &[u8],
21363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21364 let avail_len = __input.len();
21365 let mut payload_buf = [0; Self::ENCODED_LEN];
21366 let mut buf = if avail_len < Self::ENCODED_LEN {
21367 payload_buf[0..avail_len].copy_from_slice(__input);
21368 Bytes::new(&payload_buf)
21369 } else {
21370 Bytes::new(__input)
21371 };
21372 let mut __struct = Self::default();
21373 __struct.start_index = buf.get_i16_le()?;
21374 __struct.end_index = buf.get_i16_le()?;
21375 __struct.target_system = buf.get_u8()?;
21376 __struct.target_component = buf.get_u8()?;
21377 let tmp = buf.get_u8()?;
21378 __struct.mission_type =
21379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21380 enum_type: "MavMissionType",
21381 value: tmp as u64,
21382 })?;
21383 Ok(__struct)
21384 }
21385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21386 let mut __tmp = BytesMut::new(bytes);
21387 #[allow(clippy::absurd_extreme_comparisons)]
21388 #[allow(unused_comparisons)]
21389 if __tmp.remaining() < Self::ENCODED_LEN {
21390 panic!(
21391 "buffer is too small (need {} bytes, but got {})",
21392 Self::ENCODED_LEN,
21393 __tmp.remaining(),
21394 )
21395 }
21396 __tmp.put_i16_le(self.start_index);
21397 __tmp.put_i16_le(self.end_index);
21398 __tmp.put_u8(self.target_system);
21399 __tmp.put_u8(self.target_component);
21400 if matches!(version, MavlinkVersion::V2) {
21401 __tmp.put_u8(self.mission_type as u8);
21402 let len = __tmp.len();
21403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21404 } else {
21405 __tmp.len()
21406 }
21407 }
21408}
21409#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21410#[doc = "Orientation of a mount."]
21411#[doc = ""]
21412#[doc = "ID: 265"]
21413#[derive(Debug, Clone, PartialEq)]
21414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21416#[cfg_attr(feature = "ts", derive(TS))]
21417#[cfg_attr(feature = "ts", ts(export))]
21418pub struct MOUNT_ORIENTATION_DATA {
21419 #[doc = "Timestamp (time since system boot)."]
21420 pub time_boot_ms: u32,
21421 #[doc = "Roll in global frame (set to NaN for invalid)."]
21422 pub roll: f32,
21423 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21424 pub pitch: f32,
21425 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21426 pub yaw: f32,
21427 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21428 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21429 pub yaw_absolute: f32,
21430}
21431impl MOUNT_ORIENTATION_DATA {
21432 pub const ENCODED_LEN: usize = 20usize;
21433 pub const DEFAULT: Self = Self {
21434 time_boot_ms: 0_u32,
21435 roll: 0.0_f32,
21436 pitch: 0.0_f32,
21437 yaw: 0.0_f32,
21438 yaw_absolute: 0.0_f32,
21439 };
21440 #[cfg(feature = "arbitrary")]
21441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21442 use arbitrary::{Arbitrary, Unstructured};
21443 let mut buf = [0u8; 1024];
21444 rng.fill_bytes(&mut buf);
21445 let mut unstructured = Unstructured::new(&buf);
21446 Self::arbitrary(&mut unstructured).unwrap_or_default()
21447 }
21448}
21449impl Default for MOUNT_ORIENTATION_DATA {
21450 fn default() -> Self {
21451 Self::DEFAULT.clone()
21452 }
21453}
21454impl MessageData for MOUNT_ORIENTATION_DATA {
21455 type Message = MavMessage;
21456 const ID: u32 = 265u32;
21457 const NAME: &'static str = "MOUNT_ORIENTATION";
21458 const EXTRA_CRC: u8 = 26u8;
21459 const ENCODED_LEN: usize = 20usize;
21460 fn deser(
21461 _version: MavlinkVersion,
21462 __input: &[u8],
21463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21464 let avail_len = __input.len();
21465 let mut payload_buf = [0; Self::ENCODED_LEN];
21466 let mut buf = if avail_len < Self::ENCODED_LEN {
21467 payload_buf[0..avail_len].copy_from_slice(__input);
21468 Bytes::new(&payload_buf)
21469 } else {
21470 Bytes::new(__input)
21471 };
21472 let mut __struct = Self::default();
21473 __struct.time_boot_ms = buf.get_u32_le()?;
21474 __struct.roll = buf.get_f32_le()?;
21475 __struct.pitch = buf.get_f32_le()?;
21476 __struct.yaw = buf.get_f32_le()?;
21477 __struct.yaw_absolute = buf.get_f32_le()?;
21478 Ok(__struct)
21479 }
21480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21481 let mut __tmp = BytesMut::new(bytes);
21482 #[allow(clippy::absurd_extreme_comparisons)]
21483 #[allow(unused_comparisons)]
21484 if __tmp.remaining() < Self::ENCODED_LEN {
21485 panic!(
21486 "buffer is too small (need {} bytes, but got {})",
21487 Self::ENCODED_LEN,
21488 __tmp.remaining(),
21489 )
21490 }
21491 __tmp.put_u32_le(self.time_boot_ms);
21492 __tmp.put_f32_le(self.roll);
21493 __tmp.put_f32_le(self.pitch);
21494 __tmp.put_f32_le(self.yaw);
21495 if matches!(version, MavlinkVersion::V2) {
21496 __tmp.put_f32_le(self.yaw_absolute);
21497 let len = __tmp.len();
21498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21499 } else {
21500 __tmp.len()
21501 }
21502 }
21503}
21504#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21505#[doc = ""]
21506#[doc = "ID: 251"]
21507#[derive(Debug, Clone, PartialEq)]
21508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21510#[cfg_attr(feature = "ts", derive(TS))]
21511#[cfg_attr(feature = "ts", ts(export))]
21512pub struct NAMED_VALUE_FLOAT_DATA {
21513 #[doc = "Timestamp (time since system boot)."]
21514 pub time_boot_ms: u32,
21515 #[doc = "Floating point value"]
21516 pub value: f32,
21517 #[doc = "Name of the debug variable"]
21518 #[cfg_attr(feature = "ts", ts(type = "string"))]
21519 pub name: CharArray<10>,
21520}
21521impl NAMED_VALUE_FLOAT_DATA {
21522 pub const ENCODED_LEN: usize = 18usize;
21523 pub const DEFAULT: Self = Self {
21524 time_boot_ms: 0_u32,
21525 value: 0.0_f32,
21526 name: CharArray::new([0_u8; 10usize]),
21527 };
21528 #[cfg(feature = "arbitrary")]
21529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21530 use arbitrary::{Arbitrary, Unstructured};
21531 let mut buf = [0u8; 1024];
21532 rng.fill_bytes(&mut buf);
21533 let mut unstructured = Unstructured::new(&buf);
21534 Self::arbitrary(&mut unstructured).unwrap_or_default()
21535 }
21536}
21537impl Default for NAMED_VALUE_FLOAT_DATA {
21538 fn default() -> Self {
21539 Self::DEFAULT.clone()
21540 }
21541}
21542impl MessageData for NAMED_VALUE_FLOAT_DATA {
21543 type Message = MavMessage;
21544 const ID: u32 = 251u32;
21545 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21546 const EXTRA_CRC: u8 = 170u8;
21547 const ENCODED_LEN: usize = 18usize;
21548 fn deser(
21549 _version: MavlinkVersion,
21550 __input: &[u8],
21551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21552 let avail_len = __input.len();
21553 let mut payload_buf = [0; Self::ENCODED_LEN];
21554 let mut buf = if avail_len < Self::ENCODED_LEN {
21555 payload_buf[0..avail_len].copy_from_slice(__input);
21556 Bytes::new(&payload_buf)
21557 } else {
21558 Bytes::new(__input)
21559 };
21560 let mut __struct = Self::default();
21561 __struct.time_boot_ms = buf.get_u32_le()?;
21562 __struct.value = buf.get_f32_le()?;
21563 let mut tmp = [0_u8; 10usize];
21564 for v in &mut tmp {
21565 *v = buf.get_u8()?;
21566 }
21567 __struct.name = CharArray::new(tmp);
21568 Ok(__struct)
21569 }
21570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21571 let mut __tmp = BytesMut::new(bytes);
21572 #[allow(clippy::absurd_extreme_comparisons)]
21573 #[allow(unused_comparisons)]
21574 if __tmp.remaining() < Self::ENCODED_LEN {
21575 panic!(
21576 "buffer is too small (need {} bytes, but got {})",
21577 Self::ENCODED_LEN,
21578 __tmp.remaining(),
21579 )
21580 }
21581 __tmp.put_u32_le(self.time_boot_ms);
21582 __tmp.put_f32_le(self.value);
21583 for val in &self.name {
21584 __tmp.put_u8(*val);
21585 }
21586 if matches!(version, MavlinkVersion::V2) {
21587 let len = __tmp.len();
21588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21589 } else {
21590 __tmp.len()
21591 }
21592 }
21593}
21594#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21595#[doc = ""]
21596#[doc = "ID: 252"]
21597#[derive(Debug, Clone, PartialEq)]
21598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21600#[cfg_attr(feature = "ts", derive(TS))]
21601#[cfg_attr(feature = "ts", ts(export))]
21602pub struct NAMED_VALUE_INT_DATA {
21603 #[doc = "Timestamp (time since system boot)."]
21604 pub time_boot_ms: u32,
21605 #[doc = "Signed integer value"]
21606 pub value: i32,
21607 #[doc = "Name of the debug variable"]
21608 #[cfg_attr(feature = "ts", ts(type = "string"))]
21609 pub name: CharArray<10>,
21610}
21611impl NAMED_VALUE_INT_DATA {
21612 pub const ENCODED_LEN: usize = 18usize;
21613 pub const DEFAULT: Self = Self {
21614 time_boot_ms: 0_u32,
21615 value: 0_i32,
21616 name: CharArray::new([0_u8; 10usize]),
21617 };
21618 #[cfg(feature = "arbitrary")]
21619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21620 use arbitrary::{Arbitrary, Unstructured};
21621 let mut buf = [0u8; 1024];
21622 rng.fill_bytes(&mut buf);
21623 let mut unstructured = Unstructured::new(&buf);
21624 Self::arbitrary(&mut unstructured).unwrap_or_default()
21625 }
21626}
21627impl Default for NAMED_VALUE_INT_DATA {
21628 fn default() -> Self {
21629 Self::DEFAULT.clone()
21630 }
21631}
21632impl MessageData for NAMED_VALUE_INT_DATA {
21633 type Message = MavMessage;
21634 const ID: u32 = 252u32;
21635 const NAME: &'static str = "NAMED_VALUE_INT";
21636 const EXTRA_CRC: u8 = 44u8;
21637 const ENCODED_LEN: usize = 18usize;
21638 fn deser(
21639 _version: MavlinkVersion,
21640 __input: &[u8],
21641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21642 let avail_len = __input.len();
21643 let mut payload_buf = [0; Self::ENCODED_LEN];
21644 let mut buf = if avail_len < Self::ENCODED_LEN {
21645 payload_buf[0..avail_len].copy_from_slice(__input);
21646 Bytes::new(&payload_buf)
21647 } else {
21648 Bytes::new(__input)
21649 };
21650 let mut __struct = Self::default();
21651 __struct.time_boot_ms = buf.get_u32_le()?;
21652 __struct.value = buf.get_i32_le()?;
21653 let mut tmp = [0_u8; 10usize];
21654 for v in &mut tmp {
21655 *v = buf.get_u8()?;
21656 }
21657 __struct.name = CharArray::new(tmp);
21658 Ok(__struct)
21659 }
21660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21661 let mut __tmp = BytesMut::new(bytes);
21662 #[allow(clippy::absurd_extreme_comparisons)]
21663 #[allow(unused_comparisons)]
21664 if __tmp.remaining() < Self::ENCODED_LEN {
21665 panic!(
21666 "buffer is too small (need {} bytes, but got {})",
21667 Self::ENCODED_LEN,
21668 __tmp.remaining(),
21669 )
21670 }
21671 __tmp.put_u32_le(self.time_boot_ms);
21672 __tmp.put_i32_le(self.value);
21673 for val in &self.name {
21674 __tmp.put_u8(*val);
21675 }
21676 if matches!(version, MavlinkVersion::V2) {
21677 let len = __tmp.len();
21678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21679 } else {
21680 __tmp.len()
21681 }
21682 }
21683}
21684#[doc = "The state of the navigation and position controller."]
21685#[doc = ""]
21686#[doc = "ID: 62"]
21687#[derive(Debug, Clone, PartialEq)]
21688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21690#[cfg_attr(feature = "ts", derive(TS))]
21691#[cfg_attr(feature = "ts", ts(export))]
21692pub struct NAV_CONTROLLER_OUTPUT_DATA {
21693 #[doc = "Current desired roll"]
21694 pub nav_roll: f32,
21695 #[doc = "Current desired pitch"]
21696 pub nav_pitch: f32,
21697 #[doc = "Current altitude error"]
21698 pub alt_error: f32,
21699 #[doc = "Current airspeed error"]
21700 pub aspd_error: f32,
21701 #[doc = "Current crosstrack error on x-y plane"]
21702 pub xtrack_error: f32,
21703 #[doc = "Current desired heading"]
21704 pub nav_bearing: i16,
21705 #[doc = "Bearing to current waypoint/target"]
21706 pub target_bearing: i16,
21707 #[doc = "Distance to active waypoint"]
21708 pub wp_dist: u16,
21709}
21710impl NAV_CONTROLLER_OUTPUT_DATA {
21711 pub const ENCODED_LEN: usize = 26usize;
21712 pub const DEFAULT: Self = Self {
21713 nav_roll: 0.0_f32,
21714 nav_pitch: 0.0_f32,
21715 alt_error: 0.0_f32,
21716 aspd_error: 0.0_f32,
21717 xtrack_error: 0.0_f32,
21718 nav_bearing: 0_i16,
21719 target_bearing: 0_i16,
21720 wp_dist: 0_u16,
21721 };
21722 #[cfg(feature = "arbitrary")]
21723 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21724 use arbitrary::{Arbitrary, Unstructured};
21725 let mut buf = [0u8; 1024];
21726 rng.fill_bytes(&mut buf);
21727 let mut unstructured = Unstructured::new(&buf);
21728 Self::arbitrary(&mut unstructured).unwrap_or_default()
21729 }
21730}
21731impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21732 fn default() -> Self {
21733 Self::DEFAULT.clone()
21734 }
21735}
21736impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21737 type Message = MavMessage;
21738 const ID: u32 = 62u32;
21739 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21740 const EXTRA_CRC: u8 = 183u8;
21741 const ENCODED_LEN: usize = 26usize;
21742 fn deser(
21743 _version: MavlinkVersion,
21744 __input: &[u8],
21745 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21746 let avail_len = __input.len();
21747 let mut payload_buf = [0; Self::ENCODED_LEN];
21748 let mut buf = if avail_len < Self::ENCODED_LEN {
21749 payload_buf[0..avail_len].copy_from_slice(__input);
21750 Bytes::new(&payload_buf)
21751 } else {
21752 Bytes::new(__input)
21753 };
21754 let mut __struct = Self::default();
21755 __struct.nav_roll = buf.get_f32_le()?;
21756 __struct.nav_pitch = buf.get_f32_le()?;
21757 __struct.alt_error = buf.get_f32_le()?;
21758 __struct.aspd_error = buf.get_f32_le()?;
21759 __struct.xtrack_error = buf.get_f32_le()?;
21760 __struct.nav_bearing = buf.get_i16_le()?;
21761 __struct.target_bearing = buf.get_i16_le()?;
21762 __struct.wp_dist = buf.get_u16_le()?;
21763 Ok(__struct)
21764 }
21765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21766 let mut __tmp = BytesMut::new(bytes);
21767 #[allow(clippy::absurd_extreme_comparisons)]
21768 #[allow(unused_comparisons)]
21769 if __tmp.remaining() < Self::ENCODED_LEN {
21770 panic!(
21771 "buffer is too small (need {} bytes, but got {})",
21772 Self::ENCODED_LEN,
21773 __tmp.remaining(),
21774 )
21775 }
21776 __tmp.put_f32_le(self.nav_roll);
21777 __tmp.put_f32_le(self.nav_pitch);
21778 __tmp.put_f32_le(self.alt_error);
21779 __tmp.put_f32_le(self.aspd_error);
21780 __tmp.put_f32_le(self.xtrack_error);
21781 __tmp.put_i16_le(self.nav_bearing);
21782 __tmp.put_i16_le(self.target_bearing);
21783 __tmp.put_u16_le(self.wp_dist);
21784 if matches!(version, MavlinkVersion::V2) {
21785 let len = __tmp.len();
21786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21787 } else {
21788 __tmp.len()
21789 }
21790 }
21791}
21792#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21793#[doc = ""]
21794#[doc = "ID: 330"]
21795#[derive(Debug, Clone, PartialEq)]
21796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21798#[cfg_attr(feature = "ts", derive(TS))]
21799#[cfg_attr(feature = "ts", ts(export))]
21800pub struct OBSTACLE_DISTANCE_DATA {
21801 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21802 pub time_usec: u64,
21803 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21804 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21805 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21806 pub distances: [u16; 72],
21807 #[doc = "Minimum distance the sensor can measure."]
21808 pub min_distance: u16,
21809 #[doc = "Maximum distance the sensor can measure."]
21810 pub max_distance: u16,
21811 #[doc = "Class id of the distance sensor type."]
21812 pub sensor_type: MavDistanceSensor,
21813 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21814 pub increment: u8,
21815 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21816 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21817 pub increment_f: f32,
21818 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21819 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21820 pub angle_offset: f32,
21821 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21822 #[cfg_attr(feature = "serde", serde(default))]
21823 pub frame: MavFrame,
21824}
21825impl OBSTACLE_DISTANCE_DATA {
21826 pub const ENCODED_LEN: usize = 167usize;
21827 pub const DEFAULT: Self = Self {
21828 time_usec: 0_u64,
21829 distances: [0_u16; 72usize],
21830 min_distance: 0_u16,
21831 max_distance: 0_u16,
21832 sensor_type: MavDistanceSensor::DEFAULT,
21833 increment: 0_u8,
21834 increment_f: 0.0_f32,
21835 angle_offset: 0.0_f32,
21836 frame: MavFrame::DEFAULT,
21837 };
21838 #[cfg(feature = "arbitrary")]
21839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21840 use arbitrary::{Arbitrary, Unstructured};
21841 let mut buf = [0u8; 1024];
21842 rng.fill_bytes(&mut buf);
21843 let mut unstructured = Unstructured::new(&buf);
21844 Self::arbitrary(&mut unstructured).unwrap_or_default()
21845 }
21846}
21847impl Default for OBSTACLE_DISTANCE_DATA {
21848 fn default() -> Self {
21849 Self::DEFAULT.clone()
21850 }
21851}
21852impl MessageData for OBSTACLE_DISTANCE_DATA {
21853 type Message = MavMessage;
21854 const ID: u32 = 330u32;
21855 const NAME: &'static str = "OBSTACLE_DISTANCE";
21856 const EXTRA_CRC: u8 = 23u8;
21857 const ENCODED_LEN: usize = 167usize;
21858 fn deser(
21859 _version: MavlinkVersion,
21860 __input: &[u8],
21861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21862 let avail_len = __input.len();
21863 let mut payload_buf = [0; Self::ENCODED_LEN];
21864 let mut buf = if avail_len < Self::ENCODED_LEN {
21865 payload_buf[0..avail_len].copy_from_slice(__input);
21866 Bytes::new(&payload_buf)
21867 } else {
21868 Bytes::new(__input)
21869 };
21870 let mut __struct = Self::default();
21871 __struct.time_usec = buf.get_u64_le()?;
21872 for v in &mut __struct.distances {
21873 let val = buf.get_u16_le()?;
21874 *v = val;
21875 }
21876 __struct.min_distance = buf.get_u16_le()?;
21877 __struct.max_distance = buf.get_u16_le()?;
21878 let tmp = buf.get_u8()?;
21879 __struct.sensor_type =
21880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21881 enum_type: "MavDistanceSensor",
21882 value: tmp as u64,
21883 })?;
21884 __struct.increment = buf.get_u8()?;
21885 __struct.increment_f = buf.get_f32_le()?;
21886 __struct.angle_offset = buf.get_f32_le()?;
21887 let tmp = buf.get_u8()?;
21888 __struct.frame =
21889 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21890 enum_type: "MavFrame",
21891 value: tmp as u64,
21892 })?;
21893 Ok(__struct)
21894 }
21895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21896 let mut __tmp = BytesMut::new(bytes);
21897 #[allow(clippy::absurd_extreme_comparisons)]
21898 #[allow(unused_comparisons)]
21899 if __tmp.remaining() < Self::ENCODED_LEN {
21900 panic!(
21901 "buffer is too small (need {} bytes, but got {})",
21902 Self::ENCODED_LEN,
21903 __tmp.remaining(),
21904 )
21905 }
21906 __tmp.put_u64_le(self.time_usec);
21907 for val in &self.distances {
21908 __tmp.put_u16_le(*val);
21909 }
21910 __tmp.put_u16_le(self.min_distance);
21911 __tmp.put_u16_le(self.max_distance);
21912 __tmp.put_u8(self.sensor_type as u8);
21913 __tmp.put_u8(self.increment);
21914 if matches!(version, MavlinkVersion::V2) {
21915 __tmp.put_f32_le(self.increment_f);
21916 __tmp.put_f32_le(self.angle_offset);
21917 __tmp.put_u8(self.frame as u8);
21918 let len = __tmp.len();
21919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21920 } else {
21921 __tmp.len()
21922 }
21923 }
21924}
21925#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21926#[doc = ""]
21927#[doc = "ID: 331"]
21928#[derive(Debug, Clone, PartialEq)]
21929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21931#[cfg_attr(feature = "ts", derive(TS))]
21932#[cfg_attr(feature = "ts", ts(export))]
21933pub struct ODOMETRY_DATA {
21934 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21935 pub time_usec: u64,
21936 #[doc = "X Position"]
21937 pub x: f32,
21938 #[doc = "Y Position"]
21939 pub y: f32,
21940 #[doc = "Z Position"]
21941 pub z: f32,
21942 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21943 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21944 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21945 pub q: [f32; 4],
21946 #[doc = "X linear speed"]
21947 pub vx: f32,
21948 #[doc = "Y linear speed"]
21949 pub vy: f32,
21950 #[doc = "Z linear speed"]
21951 pub vz: f32,
21952 #[doc = "Roll angular speed"]
21953 pub rollspeed: f32,
21954 #[doc = "Pitch angular speed"]
21955 pub pitchspeed: f32,
21956 #[doc = "Yaw angular speed"]
21957 pub yawspeed: f32,
21958 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21960 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21961 pub pose_covariance: [f32; 21],
21962 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21964 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21965 pub velocity_covariance: [f32; 21],
21966 #[doc = "Coordinate frame of reference for the pose data."]
21967 pub frame_id: MavFrame,
21968 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21969 pub child_frame_id: MavFrame,
21970 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21971 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21972 pub reset_counter: u8,
21973 #[doc = "Type of estimator that is providing the odometry."]
21974 #[cfg_attr(feature = "serde", serde(default))]
21975 pub estimator_type: MavEstimatorType,
21976 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21978 pub quality: i8,
21979}
21980impl ODOMETRY_DATA {
21981 pub const ENCODED_LEN: usize = 233usize;
21982 pub const DEFAULT: Self = Self {
21983 time_usec: 0_u64,
21984 x: 0.0_f32,
21985 y: 0.0_f32,
21986 z: 0.0_f32,
21987 q: [0.0_f32; 4usize],
21988 vx: 0.0_f32,
21989 vy: 0.0_f32,
21990 vz: 0.0_f32,
21991 rollspeed: 0.0_f32,
21992 pitchspeed: 0.0_f32,
21993 yawspeed: 0.0_f32,
21994 pose_covariance: [0.0_f32; 21usize],
21995 velocity_covariance: [0.0_f32; 21usize],
21996 frame_id: MavFrame::DEFAULT,
21997 child_frame_id: MavFrame::DEFAULT,
21998 reset_counter: 0_u8,
21999 estimator_type: MavEstimatorType::DEFAULT,
22000 quality: 0_i8,
22001 };
22002 #[cfg(feature = "arbitrary")]
22003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22004 use arbitrary::{Arbitrary, Unstructured};
22005 let mut buf = [0u8; 1024];
22006 rng.fill_bytes(&mut buf);
22007 let mut unstructured = Unstructured::new(&buf);
22008 Self::arbitrary(&mut unstructured).unwrap_or_default()
22009 }
22010}
22011impl Default for ODOMETRY_DATA {
22012 fn default() -> Self {
22013 Self::DEFAULT.clone()
22014 }
22015}
22016impl MessageData for ODOMETRY_DATA {
22017 type Message = MavMessage;
22018 const ID: u32 = 331u32;
22019 const NAME: &'static str = "ODOMETRY";
22020 const EXTRA_CRC: u8 = 91u8;
22021 const ENCODED_LEN: usize = 233usize;
22022 fn deser(
22023 _version: MavlinkVersion,
22024 __input: &[u8],
22025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22026 let avail_len = __input.len();
22027 let mut payload_buf = [0; Self::ENCODED_LEN];
22028 let mut buf = if avail_len < Self::ENCODED_LEN {
22029 payload_buf[0..avail_len].copy_from_slice(__input);
22030 Bytes::new(&payload_buf)
22031 } else {
22032 Bytes::new(__input)
22033 };
22034 let mut __struct = Self::default();
22035 __struct.time_usec = buf.get_u64_le()?;
22036 __struct.x = buf.get_f32_le()?;
22037 __struct.y = buf.get_f32_le()?;
22038 __struct.z = buf.get_f32_le()?;
22039 for v in &mut __struct.q {
22040 let val = buf.get_f32_le()?;
22041 *v = val;
22042 }
22043 __struct.vx = buf.get_f32_le()?;
22044 __struct.vy = buf.get_f32_le()?;
22045 __struct.vz = buf.get_f32_le()?;
22046 __struct.rollspeed = buf.get_f32_le()?;
22047 __struct.pitchspeed = buf.get_f32_le()?;
22048 __struct.yawspeed = buf.get_f32_le()?;
22049 for v in &mut __struct.pose_covariance {
22050 let val = buf.get_f32_le()?;
22051 *v = val;
22052 }
22053 for v in &mut __struct.velocity_covariance {
22054 let val = buf.get_f32_le()?;
22055 *v = val;
22056 }
22057 let tmp = buf.get_u8()?;
22058 __struct.frame_id =
22059 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22060 enum_type: "MavFrame",
22061 value: tmp as u64,
22062 })?;
22063 let tmp = buf.get_u8()?;
22064 __struct.child_frame_id =
22065 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22066 enum_type: "MavFrame",
22067 value: tmp as u64,
22068 })?;
22069 __struct.reset_counter = buf.get_u8()?;
22070 let tmp = buf.get_u8()?;
22071 __struct.estimator_type =
22072 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22073 enum_type: "MavEstimatorType",
22074 value: tmp as u64,
22075 })?;
22076 __struct.quality = buf.get_i8()?;
22077 Ok(__struct)
22078 }
22079 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22080 let mut __tmp = BytesMut::new(bytes);
22081 #[allow(clippy::absurd_extreme_comparisons)]
22082 #[allow(unused_comparisons)]
22083 if __tmp.remaining() < Self::ENCODED_LEN {
22084 panic!(
22085 "buffer is too small (need {} bytes, but got {})",
22086 Self::ENCODED_LEN,
22087 __tmp.remaining(),
22088 )
22089 }
22090 __tmp.put_u64_le(self.time_usec);
22091 __tmp.put_f32_le(self.x);
22092 __tmp.put_f32_le(self.y);
22093 __tmp.put_f32_le(self.z);
22094 for val in &self.q {
22095 __tmp.put_f32_le(*val);
22096 }
22097 __tmp.put_f32_le(self.vx);
22098 __tmp.put_f32_le(self.vy);
22099 __tmp.put_f32_le(self.vz);
22100 __tmp.put_f32_le(self.rollspeed);
22101 __tmp.put_f32_le(self.pitchspeed);
22102 __tmp.put_f32_le(self.yawspeed);
22103 for val in &self.pose_covariance {
22104 __tmp.put_f32_le(*val);
22105 }
22106 for val in &self.velocity_covariance {
22107 __tmp.put_f32_le(*val);
22108 }
22109 __tmp.put_u8(self.frame_id as u8);
22110 __tmp.put_u8(self.child_frame_id as u8);
22111 if matches!(version, MavlinkVersion::V2) {
22112 __tmp.put_u8(self.reset_counter);
22113 __tmp.put_u8(self.estimator_type as u8);
22114 __tmp.put_i8(self.quality);
22115 let len = __tmp.len();
22116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22117 } else {
22118 __tmp.len()
22119 }
22120 }
22121}
22122#[doc = "Hardware status sent by an onboard computer."]
22123#[doc = ""]
22124#[doc = "ID: 390"]
22125#[derive(Debug, Clone, PartialEq)]
22126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22128#[cfg_attr(feature = "ts", derive(TS))]
22129#[cfg_attr(feature = "ts", ts(export))]
22130pub struct ONBOARD_COMPUTER_STATUS_DATA {
22131 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22132 pub time_usec: u64,
22133 #[doc = "Time since system boot."]
22134 pub uptime: u32,
22135 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22136 pub ram_usage: u32,
22137 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22138 pub ram_total: u32,
22139 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
22140 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22141 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22142 pub storage_type: [u32; 4],
22143 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22144 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22145 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22146 pub storage_usage: [u32; 4],
22147 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22148 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22149 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22150 pub storage_total: [u32; 4],
22151 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
22152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22153 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22154 pub link_type: [u32; 6],
22155 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
22156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22157 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22158 pub link_tx_rate: [u32; 6],
22159 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
22160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22161 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22162 pub link_rx_rate: [u32; 6],
22163 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
22164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22165 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22166 pub link_tx_max: [u32; 6],
22167 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
22168 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22169 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22170 pub link_rx_max: [u32; 6],
22171 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
22172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22173 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22174 pub fan_speed: [i16; 4],
22175 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
22176 pub mavtype: u8,
22177 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22179 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22180 pub cpu_cores: [u8; 8],
22181 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22183 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22184 pub cpu_combined: [u8; 10],
22185 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22186 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22187 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22188 pub gpu_cores: [u8; 4],
22189 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22191 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22192 pub gpu_combined: [u8; 10],
22193 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
22194 pub temperature_board: i8,
22195 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
22196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22197 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22198 pub temperature_core: [i8; 8],
22199}
22200impl ONBOARD_COMPUTER_STATUS_DATA {
22201 pub const ENCODED_LEN: usize = 238usize;
22202 pub const DEFAULT: Self = Self {
22203 time_usec: 0_u64,
22204 uptime: 0_u32,
22205 ram_usage: 0_u32,
22206 ram_total: 0_u32,
22207 storage_type: [0_u32; 4usize],
22208 storage_usage: [0_u32; 4usize],
22209 storage_total: [0_u32; 4usize],
22210 link_type: [0_u32; 6usize],
22211 link_tx_rate: [0_u32; 6usize],
22212 link_rx_rate: [0_u32; 6usize],
22213 link_tx_max: [0_u32; 6usize],
22214 link_rx_max: [0_u32; 6usize],
22215 fan_speed: [0_i16; 4usize],
22216 mavtype: 0_u8,
22217 cpu_cores: [0_u8; 8usize],
22218 cpu_combined: [0_u8; 10usize],
22219 gpu_cores: [0_u8; 4usize],
22220 gpu_combined: [0_u8; 10usize],
22221 temperature_board: 0_i8,
22222 temperature_core: [0_i8; 8usize],
22223 };
22224 #[cfg(feature = "arbitrary")]
22225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22226 use arbitrary::{Arbitrary, Unstructured};
22227 let mut buf = [0u8; 1024];
22228 rng.fill_bytes(&mut buf);
22229 let mut unstructured = Unstructured::new(&buf);
22230 Self::arbitrary(&mut unstructured).unwrap_or_default()
22231 }
22232}
22233impl Default for ONBOARD_COMPUTER_STATUS_DATA {
22234 fn default() -> Self {
22235 Self::DEFAULT.clone()
22236 }
22237}
22238impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
22239 type Message = MavMessage;
22240 const ID: u32 = 390u32;
22241 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
22242 const EXTRA_CRC: u8 = 156u8;
22243 const ENCODED_LEN: usize = 238usize;
22244 fn deser(
22245 _version: MavlinkVersion,
22246 __input: &[u8],
22247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22248 let avail_len = __input.len();
22249 let mut payload_buf = [0; Self::ENCODED_LEN];
22250 let mut buf = if avail_len < Self::ENCODED_LEN {
22251 payload_buf[0..avail_len].copy_from_slice(__input);
22252 Bytes::new(&payload_buf)
22253 } else {
22254 Bytes::new(__input)
22255 };
22256 let mut __struct = Self::default();
22257 __struct.time_usec = buf.get_u64_le()?;
22258 __struct.uptime = buf.get_u32_le()?;
22259 __struct.ram_usage = buf.get_u32_le()?;
22260 __struct.ram_total = buf.get_u32_le()?;
22261 for v in &mut __struct.storage_type {
22262 let val = buf.get_u32_le()?;
22263 *v = val;
22264 }
22265 for v in &mut __struct.storage_usage {
22266 let val = buf.get_u32_le()?;
22267 *v = val;
22268 }
22269 for v in &mut __struct.storage_total {
22270 let val = buf.get_u32_le()?;
22271 *v = val;
22272 }
22273 for v in &mut __struct.link_type {
22274 let val = buf.get_u32_le()?;
22275 *v = val;
22276 }
22277 for v in &mut __struct.link_tx_rate {
22278 let val = buf.get_u32_le()?;
22279 *v = val;
22280 }
22281 for v in &mut __struct.link_rx_rate {
22282 let val = buf.get_u32_le()?;
22283 *v = val;
22284 }
22285 for v in &mut __struct.link_tx_max {
22286 let val = buf.get_u32_le()?;
22287 *v = val;
22288 }
22289 for v in &mut __struct.link_rx_max {
22290 let val = buf.get_u32_le()?;
22291 *v = val;
22292 }
22293 for v in &mut __struct.fan_speed {
22294 let val = buf.get_i16_le()?;
22295 *v = val;
22296 }
22297 __struct.mavtype = buf.get_u8()?;
22298 for v in &mut __struct.cpu_cores {
22299 let val = buf.get_u8()?;
22300 *v = val;
22301 }
22302 for v in &mut __struct.cpu_combined {
22303 let val = buf.get_u8()?;
22304 *v = val;
22305 }
22306 for v in &mut __struct.gpu_cores {
22307 let val = buf.get_u8()?;
22308 *v = val;
22309 }
22310 for v in &mut __struct.gpu_combined {
22311 let val = buf.get_u8()?;
22312 *v = val;
22313 }
22314 __struct.temperature_board = buf.get_i8()?;
22315 for v in &mut __struct.temperature_core {
22316 let val = buf.get_i8()?;
22317 *v = val;
22318 }
22319 Ok(__struct)
22320 }
22321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22322 let mut __tmp = BytesMut::new(bytes);
22323 #[allow(clippy::absurd_extreme_comparisons)]
22324 #[allow(unused_comparisons)]
22325 if __tmp.remaining() < Self::ENCODED_LEN {
22326 panic!(
22327 "buffer is too small (need {} bytes, but got {})",
22328 Self::ENCODED_LEN,
22329 __tmp.remaining(),
22330 )
22331 }
22332 __tmp.put_u64_le(self.time_usec);
22333 __tmp.put_u32_le(self.uptime);
22334 __tmp.put_u32_le(self.ram_usage);
22335 __tmp.put_u32_le(self.ram_total);
22336 for val in &self.storage_type {
22337 __tmp.put_u32_le(*val);
22338 }
22339 for val in &self.storage_usage {
22340 __tmp.put_u32_le(*val);
22341 }
22342 for val in &self.storage_total {
22343 __tmp.put_u32_le(*val);
22344 }
22345 for val in &self.link_type {
22346 __tmp.put_u32_le(*val);
22347 }
22348 for val in &self.link_tx_rate {
22349 __tmp.put_u32_le(*val);
22350 }
22351 for val in &self.link_rx_rate {
22352 __tmp.put_u32_le(*val);
22353 }
22354 for val in &self.link_tx_max {
22355 __tmp.put_u32_le(*val);
22356 }
22357 for val in &self.link_rx_max {
22358 __tmp.put_u32_le(*val);
22359 }
22360 for val in &self.fan_speed {
22361 __tmp.put_i16_le(*val);
22362 }
22363 __tmp.put_u8(self.mavtype);
22364 for val in &self.cpu_cores {
22365 __tmp.put_u8(*val);
22366 }
22367 for val in &self.cpu_combined {
22368 __tmp.put_u8(*val);
22369 }
22370 for val in &self.gpu_cores {
22371 __tmp.put_u8(*val);
22372 }
22373 for val in &self.gpu_combined {
22374 __tmp.put_u8(*val);
22375 }
22376 __tmp.put_i8(self.temperature_board);
22377 for val in &self.temperature_core {
22378 __tmp.put_i8(*val);
22379 }
22380 if matches!(version, MavlinkVersion::V2) {
22381 let len = __tmp.len();
22382 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22383 } else {
22384 __tmp.len()
22385 }
22386 }
22387}
22388#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22389#[doc = ""]
22390#[doc = "ID: 12918"]
22391#[derive(Debug, Clone, PartialEq)]
22392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22394#[cfg_attr(feature = "ts", derive(TS))]
22395#[cfg_attr(feature = "ts", ts(export))]
22396pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22397 #[doc = "Status level indicating if arming is allowed."]
22398 pub status: MavOdidArmStatus,
22399 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22400 #[cfg_attr(feature = "ts", ts(type = "string"))]
22401 pub error: CharArray<50>,
22402}
22403impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22404 pub const ENCODED_LEN: usize = 51usize;
22405 pub const DEFAULT: Self = Self {
22406 status: MavOdidArmStatus::DEFAULT,
22407 error: CharArray::new([0_u8; 50usize]),
22408 };
22409 #[cfg(feature = "arbitrary")]
22410 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22411 use arbitrary::{Arbitrary, Unstructured};
22412 let mut buf = [0u8; 1024];
22413 rng.fill_bytes(&mut buf);
22414 let mut unstructured = Unstructured::new(&buf);
22415 Self::arbitrary(&mut unstructured).unwrap_or_default()
22416 }
22417}
22418impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22419 fn default() -> Self {
22420 Self::DEFAULT.clone()
22421 }
22422}
22423impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22424 type Message = MavMessage;
22425 const ID: u32 = 12918u32;
22426 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22427 const EXTRA_CRC: u8 = 139u8;
22428 const ENCODED_LEN: usize = 51usize;
22429 fn deser(
22430 _version: MavlinkVersion,
22431 __input: &[u8],
22432 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22433 let avail_len = __input.len();
22434 let mut payload_buf = [0; Self::ENCODED_LEN];
22435 let mut buf = if avail_len < Self::ENCODED_LEN {
22436 payload_buf[0..avail_len].copy_from_slice(__input);
22437 Bytes::new(&payload_buf)
22438 } else {
22439 Bytes::new(__input)
22440 };
22441 let mut __struct = Self::default();
22442 let tmp = buf.get_u8()?;
22443 __struct.status =
22444 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22445 enum_type: "MavOdidArmStatus",
22446 value: tmp as u64,
22447 })?;
22448 let mut tmp = [0_u8; 50usize];
22449 for v in &mut tmp {
22450 *v = buf.get_u8()?;
22451 }
22452 __struct.error = CharArray::new(tmp);
22453 Ok(__struct)
22454 }
22455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22456 let mut __tmp = BytesMut::new(bytes);
22457 #[allow(clippy::absurd_extreme_comparisons)]
22458 #[allow(unused_comparisons)]
22459 if __tmp.remaining() < Self::ENCODED_LEN {
22460 panic!(
22461 "buffer is too small (need {} bytes, but got {})",
22462 Self::ENCODED_LEN,
22463 __tmp.remaining(),
22464 )
22465 }
22466 __tmp.put_u8(self.status as u8);
22467 for val in &self.error {
22468 __tmp.put_u8(*val);
22469 }
22470 if matches!(version, MavlinkVersion::V2) {
22471 let len = __tmp.len();
22472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22473 } else {
22474 __tmp.len()
22475 }
22476 }
22477}
22478#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22479#[doc = ""]
22480#[doc = "ID: 12902"]
22481#[derive(Debug, Clone, PartialEq)]
22482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22484#[cfg_attr(feature = "ts", derive(TS))]
22485#[cfg_attr(feature = "ts", ts(export))]
22486pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22487 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22488 pub timestamp: u32,
22489 #[doc = "System ID (0 for broadcast)."]
22490 pub target_system: u8,
22491 #[doc = "Component ID (0 for broadcast)."]
22492 pub target_component: u8,
22493 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22495 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22496 pub id_or_mac: [u8; 20],
22497 #[doc = "Indicates the type of authentication."]
22498 pub authentication_type: MavOdidAuthType,
22499 #[doc = "Allowed range is 0 - 15."]
22500 pub data_page: u8,
22501 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22502 pub last_page_index: u8,
22503 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22504 pub length: u8,
22505 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22507 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22508 pub authentication_data: [u8; 23],
22509}
22510impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22511 pub const ENCODED_LEN: usize = 53usize;
22512 pub const DEFAULT: Self = Self {
22513 timestamp: 0_u32,
22514 target_system: 0_u8,
22515 target_component: 0_u8,
22516 id_or_mac: [0_u8; 20usize],
22517 authentication_type: MavOdidAuthType::DEFAULT,
22518 data_page: 0_u8,
22519 last_page_index: 0_u8,
22520 length: 0_u8,
22521 authentication_data: [0_u8; 23usize],
22522 };
22523 #[cfg(feature = "arbitrary")]
22524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22525 use arbitrary::{Arbitrary, Unstructured};
22526 let mut buf = [0u8; 1024];
22527 rng.fill_bytes(&mut buf);
22528 let mut unstructured = Unstructured::new(&buf);
22529 Self::arbitrary(&mut unstructured).unwrap_or_default()
22530 }
22531}
22532impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22533 fn default() -> Self {
22534 Self::DEFAULT.clone()
22535 }
22536}
22537impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22538 type Message = MavMessage;
22539 const ID: u32 = 12902u32;
22540 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22541 const EXTRA_CRC: u8 = 140u8;
22542 const ENCODED_LEN: usize = 53usize;
22543 fn deser(
22544 _version: MavlinkVersion,
22545 __input: &[u8],
22546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22547 let avail_len = __input.len();
22548 let mut payload_buf = [0; Self::ENCODED_LEN];
22549 let mut buf = if avail_len < Self::ENCODED_LEN {
22550 payload_buf[0..avail_len].copy_from_slice(__input);
22551 Bytes::new(&payload_buf)
22552 } else {
22553 Bytes::new(__input)
22554 };
22555 let mut __struct = Self::default();
22556 __struct.timestamp = buf.get_u32_le()?;
22557 __struct.target_system = buf.get_u8()?;
22558 __struct.target_component = buf.get_u8()?;
22559 for v in &mut __struct.id_or_mac {
22560 let val = buf.get_u8()?;
22561 *v = val;
22562 }
22563 let tmp = buf.get_u8()?;
22564 __struct.authentication_type =
22565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22566 enum_type: "MavOdidAuthType",
22567 value: tmp as u64,
22568 })?;
22569 __struct.data_page = buf.get_u8()?;
22570 __struct.last_page_index = buf.get_u8()?;
22571 __struct.length = buf.get_u8()?;
22572 for v in &mut __struct.authentication_data {
22573 let val = buf.get_u8()?;
22574 *v = val;
22575 }
22576 Ok(__struct)
22577 }
22578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22579 let mut __tmp = BytesMut::new(bytes);
22580 #[allow(clippy::absurd_extreme_comparisons)]
22581 #[allow(unused_comparisons)]
22582 if __tmp.remaining() < Self::ENCODED_LEN {
22583 panic!(
22584 "buffer is too small (need {} bytes, but got {})",
22585 Self::ENCODED_LEN,
22586 __tmp.remaining(),
22587 )
22588 }
22589 __tmp.put_u32_le(self.timestamp);
22590 __tmp.put_u8(self.target_system);
22591 __tmp.put_u8(self.target_component);
22592 for val in &self.id_or_mac {
22593 __tmp.put_u8(*val);
22594 }
22595 __tmp.put_u8(self.authentication_type as u8);
22596 __tmp.put_u8(self.data_page);
22597 __tmp.put_u8(self.last_page_index);
22598 __tmp.put_u8(self.length);
22599 for val in &self.authentication_data {
22600 __tmp.put_u8(*val);
22601 }
22602 if matches!(version, MavlinkVersion::V2) {
22603 let len = __tmp.len();
22604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22605 } else {
22606 __tmp.len()
22607 }
22608 }
22609}
22610#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22611#[doc = ""]
22612#[doc = "ID: 12900"]
22613#[derive(Debug, Clone, PartialEq)]
22614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22616#[cfg_attr(feature = "ts", derive(TS))]
22617#[cfg_attr(feature = "ts", ts(export))]
22618pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22619 #[doc = "System ID (0 for broadcast)."]
22620 pub target_system: u8,
22621 #[doc = "Component ID (0 for broadcast)."]
22622 pub target_component: u8,
22623 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22624 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22625 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22626 pub id_or_mac: [u8; 20],
22627 #[doc = "Indicates the format for the uas_id field of this message."]
22628 pub id_type: MavOdidIdType,
22629 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22630 pub ua_type: MavOdidUaType,
22631 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22632 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22633 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22634 pub uas_id: [u8; 20],
22635}
22636impl OPEN_DRONE_ID_BASIC_ID_DATA {
22637 pub const ENCODED_LEN: usize = 44usize;
22638 pub const DEFAULT: Self = Self {
22639 target_system: 0_u8,
22640 target_component: 0_u8,
22641 id_or_mac: [0_u8; 20usize],
22642 id_type: MavOdidIdType::DEFAULT,
22643 ua_type: MavOdidUaType::DEFAULT,
22644 uas_id: [0_u8; 20usize],
22645 };
22646 #[cfg(feature = "arbitrary")]
22647 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22648 use arbitrary::{Arbitrary, Unstructured};
22649 let mut buf = [0u8; 1024];
22650 rng.fill_bytes(&mut buf);
22651 let mut unstructured = Unstructured::new(&buf);
22652 Self::arbitrary(&mut unstructured).unwrap_or_default()
22653 }
22654}
22655impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22656 fn default() -> Self {
22657 Self::DEFAULT.clone()
22658 }
22659}
22660impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22661 type Message = MavMessage;
22662 const ID: u32 = 12900u32;
22663 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22664 const EXTRA_CRC: u8 = 114u8;
22665 const ENCODED_LEN: usize = 44usize;
22666 fn deser(
22667 _version: MavlinkVersion,
22668 __input: &[u8],
22669 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22670 let avail_len = __input.len();
22671 let mut payload_buf = [0; Self::ENCODED_LEN];
22672 let mut buf = if avail_len < Self::ENCODED_LEN {
22673 payload_buf[0..avail_len].copy_from_slice(__input);
22674 Bytes::new(&payload_buf)
22675 } else {
22676 Bytes::new(__input)
22677 };
22678 let mut __struct = Self::default();
22679 __struct.target_system = buf.get_u8()?;
22680 __struct.target_component = buf.get_u8()?;
22681 for v in &mut __struct.id_or_mac {
22682 let val = buf.get_u8()?;
22683 *v = val;
22684 }
22685 let tmp = buf.get_u8()?;
22686 __struct.id_type =
22687 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22688 enum_type: "MavOdidIdType",
22689 value: tmp as u64,
22690 })?;
22691 let tmp = buf.get_u8()?;
22692 __struct.ua_type =
22693 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22694 enum_type: "MavOdidUaType",
22695 value: tmp as u64,
22696 })?;
22697 for v in &mut __struct.uas_id {
22698 let val = buf.get_u8()?;
22699 *v = val;
22700 }
22701 Ok(__struct)
22702 }
22703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22704 let mut __tmp = BytesMut::new(bytes);
22705 #[allow(clippy::absurd_extreme_comparisons)]
22706 #[allow(unused_comparisons)]
22707 if __tmp.remaining() < Self::ENCODED_LEN {
22708 panic!(
22709 "buffer is too small (need {} bytes, but got {})",
22710 Self::ENCODED_LEN,
22711 __tmp.remaining(),
22712 )
22713 }
22714 __tmp.put_u8(self.target_system);
22715 __tmp.put_u8(self.target_component);
22716 for val in &self.id_or_mac {
22717 __tmp.put_u8(*val);
22718 }
22719 __tmp.put_u8(self.id_type as u8);
22720 __tmp.put_u8(self.ua_type as u8);
22721 for val in &self.uas_id {
22722 __tmp.put_u8(*val);
22723 }
22724 if matches!(version, MavlinkVersion::V2) {
22725 let len = __tmp.len();
22726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22727 } else {
22728 __tmp.len()
22729 }
22730 }
22731}
22732#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22733#[doc = ""]
22734#[doc = "ID: 12901"]
22735#[derive(Debug, Clone, PartialEq)]
22736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22738#[cfg_attr(feature = "ts", derive(TS))]
22739#[cfg_attr(feature = "ts", ts(export))]
22740pub struct OPEN_DRONE_ID_LOCATION_DATA {
22741 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22742 pub latitude: i32,
22743 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22744 pub longitude: i32,
22745 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22746 pub altitude_barometric: f32,
22747 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22748 pub altitude_geodetic: f32,
22749 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22750 pub height: f32,
22751 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22752 pub timestamp: f32,
22753 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22754 pub direction: u16,
22755 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22756 pub speed_horizontal: u16,
22757 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22758 pub speed_vertical: i16,
22759 #[doc = "System ID (0 for broadcast)."]
22760 pub target_system: u8,
22761 #[doc = "Component ID (0 for broadcast)."]
22762 pub target_component: u8,
22763 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22765 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22766 pub id_or_mac: [u8; 20],
22767 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22768 pub status: MavOdidStatus,
22769 #[doc = "Indicates the reference point for the height field."]
22770 pub height_reference: MavOdidHeightRef,
22771 #[doc = "The accuracy of the horizontal position."]
22772 pub horizontal_accuracy: MavOdidHorAcc,
22773 #[doc = "The accuracy of the vertical position."]
22774 pub vertical_accuracy: MavOdidVerAcc,
22775 #[doc = "The accuracy of the barometric altitude."]
22776 pub barometer_accuracy: MavOdidVerAcc,
22777 #[doc = "The accuracy of the horizontal and vertical speed."]
22778 pub speed_accuracy: MavOdidSpeedAcc,
22779 #[doc = "The accuracy of the timestamps."]
22780 pub timestamp_accuracy: MavOdidTimeAcc,
22781}
22782impl OPEN_DRONE_ID_LOCATION_DATA {
22783 pub const ENCODED_LEN: usize = 59usize;
22784 pub const DEFAULT: Self = Self {
22785 latitude: 0_i32,
22786 longitude: 0_i32,
22787 altitude_barometric: 0.0_f32,
22788 altitude_geodetic: 0.0_f32,
22789 height: 0.0_f32,
22790 timestamp: 0.0_f32,
22791 direction: 0_u16,
22792 speed_horizontal: 0_u16,
22793 speed_vertical: 0_i16,
22794 target_system: 0_u8,
22795 target_component: 0_u8,
22796 id_or_mac: [0_u8; 20usize],
22797 status: MavOdidStatus::DEFAULT,
22798 height_reference: MavOdidHeightRef::DEFAULT,
22799 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22800 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22801 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22802 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22803 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22804 };
22805 #[cfg(feature = "arbitrary")]
22806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22807 use arbitrary::{Arbitrary, Unstructured};
22808 let mut buf = [0u8; 1024];
22809 rng.fill_bytes(&mut buf);
22810 let mut unstructured = Unstructured::new(&buf);
22811 Self::arbitrary(&mut unstructured).unwrap_or_default()
22812 }
22813}
22814impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22815 fn default() -> Self {
22816 Self::DEFAULT.clone()
22817 }
22818}
22819impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22820 type Message = MavMessage;
22821 const ID: u32 = 12901u32;
22822 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22823 const EXTRA_CRC: u8 = 254u8;
22824 const ENCODED_LEN: usize = 59usize;
22825 fn deser(
22826 _version: MavlinkVersion,
22827 __input: &[u8],
22828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22829 let avail_len = __input.len();
22830 let mut payload_buf = [0; Self::ENCODED_LEN];
22831 let mut buf = if avail_len < Self::ENCODED_LEN {
22832 payload_buf[0..avail_len].copy_from_slice(__input);
22833 Bytes::new(&payload_buf)
22834 } else {
22835 Bytes::new(__input)
22836 };
22837 let mut __struct = Self::default();
22838 __struct.latitude = buf.get_i32_le()?;
22839 __struct.longitude = buf.get_i32_le()?;
22840 __struct.altitude_barometric = buf.get_f32_le()?;
22841 __struct.altitude_geodetic = buf.get_f32_le()?;
22842 __struct.height = buf.get_f32_le()?;
22843 __struct.timestamp = buf.get_f32_le()?;
22844 __struct.direction = buf.get_u16_le()?;
22845 __struct.speed_horizontal = buf.get_u16_le()?;
22846 __struct.speed_vertical = buf.get_i16_le()?;
22847 __struct.target_system = buf.get_u8()?;
22848 __struct.target_component = buf.get_u8()?;
22849 for v in &mut __struct.id_or_mac {
22850 let val = buf.get_u8()?;
22851 *v = val;
22852 }
22853 let tmp = buf.get_u8()?;
22854 __struct.status =
22855 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22856 enum_type: "MavOdidStatus",
22857 value: tmp as u64,
22858 })?;
22859 let tmp = buf.get_u8()?;
22860 __struct.height_reference =
22861 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22862 enum_type: "MavOdidHeightRef",
22863 value: tmp as u64,
22864 })?;
22865 let tmp = buf.get_u8()?;
22866 __struct.horizontal_accuracy =
22867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22868 enum_type: "MavOdidHorAcc",
22869 value: tmp as u64,
22870 })?;
22871 let tmp = buf.get_u8()?;
22872 __struct.vertical_accuracy =
22873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22874 enum_type: "MavOdidVerAcc",
22875 value: tmp as u64,
22876 })?;
22877 let tmp = buf.get_u8()?;
22878 __struct.barometer_accuracy =
22879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22880 enum_type: "MavOdidVerAcc",
22881 value: tmp as u64,
22882 })?;
22883 let tmp = buf.get_u8()?;
22884 __struct.speed_accuracy =
22885 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22886 enum_type: "MavOdidSpeedAcc",
22887 value: tmp as u64,
22888 })?;
22889 let tmp = buf.get_u8()?;
22890 __struct.timestamp_accuracy =
22891 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22892 enum_type: "MavOdidTimeAcc",
22893 value: tmp as u64,
22894 })?;
22895 Ok(__struct)
22896 }
22897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22898 let mut __tmp = BytesMut::new(bytes);
22899 #[allow(clippy::absurd_extreme_comparisons)]
22900 #[allow(unused_comparisons)]
22901 if __tmp.remaining() < Self::ENCODED_LEN {
22902 panic!(
22903 "buffer is too small (need {} bytes, but got {})",
22904 Self::ENCODED_LEN,
22905 __tmp.remaining(),
22906 )
22907 }
22908 __tmp.put_i32_le(self.latitude);
22909 __tmp.put_i32_le(self.longitude);
22910 __tmp.put_f32_le(self.altitude_barometric);
22911 __tmp.put_f32_le(self.altitude_geodetic);
22912 __tmp.put_f32_le(self.height);
22913 __tmp.put_f32_le(self.timestamp);
22914 __tmp.put_u16_le(self.direction);
22915 __tmp.put_u16_le(self.speed_horizontal);
22916 __tmp.put_i16_le(self.speed_vertical);
22917 __tmp.put_u8(self.target_system);
22918 __tmp.put_u8(self.target_component);
22919 for val in &self.id_or_mac {
22920 __tmp.put_u8(*val);
22921 }
22922 __tmp.put_u8(self.status as u8);
22923 __tmp.put_u8(self.height_reference as u8);
22924 __tmp.put_u8(self.horizontal_accuracy as u8);
22925 __tmp.put_u8(self.vertical_accuracy as u8);
22926 __tmp.put_u8(self.barometer_accuracy as u8);
22927 __tmp.put_u8(self.speed_accuracy as u8);
22928 __tmp.put_u8(self.timestamp_accuracy as u8);
22929 if matches!(version, MavlinkVersion::V2) {
22930 let len = __tmp.len();
22931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22932 } else {
22933 __tmp.len()
22934 }
22935 }
22936}
22937#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22938#[doc = ""]
22939#[doc = "ID: 12915"]
22940#[derive(Debug, Clone, PartialEq)]
22941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22943#[cfg_attr(feature = "ts", derive(TS))]
22944#[cfg_attr(feature = "ts", ts(export))]
22945pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22946 #[doc = "System ID (0 for broadcast)."]
22947 pub target_system: u8,
22948 #[doc = "Component ID (0 for broadcast)."]
22949 pub target_component: u8,
22950 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22952 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22953 pub id_or_mac: [u8; 20],
22954 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22955 pub single_message_size: u8,
22956 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22957 pub msg_pack_size: u8,
22958 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22960 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22961 pub messages: [u8; 225],
22962}
22963impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22964 pub const ENCODED_LEN: usize = 249usize;
22965 pub const DEFAULT: Self = Self {
22966 target_system: 0_u8,
22967 target_component: 0_u8,
22968 id_or_mac: [0_u8; 20usize],
22969 single_message_size: 0_u8,
22970 msg_pack_size: 0_u8,
22971 messages: [0_u8; 225usize],
22972 };
22973 #[cfg(feature = "arbitrary")]
22974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22975 use arbitrary::{Arbitrary, Unstructured};
22976 let mut buf = [0u8; 1024];
22977 rng.fill_bytes(&mut buf);
22978 let mut unstructured = Unstructured::new(&buf);
22979 Self::arbitrary(&mut unstructured).unwrap_or_default()
22980 }
22981}
22982impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22983 fn default() -> Self {
22984 Self::DEFAULT.clone()
22985 }
22986}
22987impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22988 type Message = MavMessage;
22989 const ID: u32 = 12915u32;
22990 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22991 const EXTRA_CRC: u8 = 94u8;
22992 const ENCODED_LEN: usize = 249usize;
22993 fn deser(
22994 _version: MavlinkVersion,
22995 __input: &[u8],
22996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22997 let avail_len = __input.len();
22998 let mut payload_buf = [0; Self::ENCODED_LEN];
22999 let mut buf = if avail_len < Self::ENCODED_LEN {
23000 payload_buf[0..avail_len].copy_from_slice(__input);
23001 Bytes::new(&payload_buf)
23002 } else {
23003 Bytes::new(__input)
23004 };
23005 let mut __struct = Self::default();
23006 __struct.target_system = buf.get_u8()?;
23007 __struct.target_component = buf.get_u8()?;
23008 for v in &mut __struct.id_or_mac {
23009 let val = buf.get_u8()?;
23010 *v = val;
23011 }
23012 __struct.single_message_size = buf.get_u8()?;
23013 __struct.msg_pack_size = buf.get_u8()?;
23014 for v in &mut __struct.messages {
23015 let val = buf.get_u8()?;
23016 *v = val;
23017 }
23018 Ok(__struct)
23019 }
23020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23021 let mut __tmp = BytesMut::new(bytes);
23022 #[allow(clippy::absurd_extreme_comparisons)]
23023 #[allow(unused_comparisons)]
23024 if __tmp.remaining() < Self::ENCODED_LEN {
23025 panic!(
23026 "buffer is too small (need {} bytes, but got {})",
23027 Self::ENCODED_LEN,
23028 __tmp.remaining(),
23029 )
23030 }
23031 __tmp.put_u8(self.target_system);
23032 __tmp.put_u8(self.target_component);
23033 for val in &self.id_or_mac {
23034 __tmp.put_u8(*val);
23035 }
23036 __tmp.put_u8(self.single_message_size);
23037 __tmp.put_u8(self.msg_pack_size);
23038 for val in &self.messages {
23039 __tmp.put_u8(*val);
23040 }
23041 if matches!(version, MavlinkVersion::V2) {
23042 let len = __tmp.len();
23043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23044 } else {
23045 __tmp.len()
23046 }
23047 }
23048}
23049#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23050#[doc = ""]
23051#[doc = "ID: 12905"]
23052#[derive(Debug, Clone, PartialEq)]
23053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23055#[cfg_attr(feature = "ts", derive(TS))]
23056#[cfg_attr(feature = "ts", ts(export))]
23057pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23058 #[doc = "System ID (0 for broadcast)."]
23059 pub target_system: u8,
23060 #[doc = "Component ID (0 for broadcast)."]
23061 pub target_component: u8,
23062 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23063 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23064 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23065 pub id_or_mac: [u8; 20],
23066 #[doc = "Indicates the type of the operator_id field."]
23067 pub operator_id_type: MavOdidOperatorIdType,
23068 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23069 #[cfg_attr(feature = "ts", ts(type = "string"))]
23070 pub operator_id: CharArray<20>,
23071}
23072impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23073 pub const ENCODED_LEN: usize = 43usize;
23074 pub const DEFAULT: Self = Self {
23075 target_system: 0_u8,
23076 target_component: 0_u8,
23077 id_or_mac: [0_u8; 20usize],
23078 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23079 operator_id: CharArray::new([0_u8; 20usize]),
23080 };
23081 #[cfg(feature = "arbitrary")]
23082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23083 use arbitrary::{Arbitrary, Unstructured};
23084 let mut buf = [0u8; 1024];
23085 rng.fill_bytes(&mut buf);
23086 let mut unstructured = Unstructured::new(&buf);
23087 Self::arbitrary(&mut unstructured).unwrap_or_default()
23088 }
23089}
23090impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23091 fn default() -> Self {
23092 Self::DEFAULT.clone()
23093 }
23094}
23095impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23096 type Message = MavMessage;
23097 const ID: u32 = 12905u32;
23098 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23099 const EXTRA_CRC: u8 = 49u8;
23100 const ENCODED_LEN: usize = 43usize;
23101 fn deser(
23102 _version: MavlinkVersion,
23103 __input: &[u8],
23104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23105 let avail_len = __input.len();
23106 let mut payload_buf = [0; Self::ENCODED_LEN];
23107 let mut buf = if avail_len < Self::ENCODED_LEN {
23108 payload_buf[0..avail_len].copy_from_slice(__input);
23109 Bytes::new(&payload_buf)
23110 } else {
23111 Bytes::new(__input)
23112 };
23113 let mut __struct = Self::default();
23114 __struct.target_system = buf.get_u8()?;
23115 __struct.target_component = buf.get_u8()?;
23116 for v in &mut __struct.id_or_mac {
23117 let val = buf.get_u8()?;
23118 *v = val;
23119 }
23120 let tmp = buf.get_u8()?;
23121 __struct.operator_id_type =
23122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23123 enum_type: "MavOdidOperatorIdType",
23124 value: tmp as u64,
23125 })?;
23126 let mut tmp = [0_u8; 20usize];
23127 for v in &mut tmp {
23128 *v = buf.get_u8()?;
23129 }
23130 __struct.operator_id = CharArray::new(tmp);
23131 Ok(__struct)
23132 }
23133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23134 let mut __tmp = BytesMut::new(bytes);
23135 #[allow(clippy::absurd_extreme_comparisons)]
23136 #[allow(unused_comparisons)]
23137 if __tmp.remaining() < Self::ENCODED_LEN {
23138 panic!(
23139 "buffer is too small (need {} bytes, but got {})",
23140 Self::ENCODED_LEN,
23141 __tmp.remaining(),
23142 )
23143 }
23144 __tmp.put_u8(self.target_system);
23145 __tmp.put_u8(self.target_component);
23146 for val in &self.id_or_mac {
23147 __tmp.put_u8(*val);
23148 }
23149 __tmp.put_u8(self.operator_id_type as u8);
23150 for val in &self.operator_id {
23151 __tmp.put_u8(*val);
23152 }
23153 if matches!(version, MavlinkVersion::V2) {
23154 let len = __tmp.len();
23155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23156 } else {
23157 __tmp.len()
23158 }
23159 }
23160}
23161#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
23162#[doc = ""]
23163#[doc = "ID: 12903"]
23164#[derive(Debug, Clone, PartialEq)]
23165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23167#[cfg_attr(feature = "ts", derive(TS))]
23168#[cfg_attr(feature = "ts", ts(export))]
23169pub struct OPEN_DRONE_ID_SELF_ID_DATA {
23170 #[doc = "System ID (0 for broadcast)."]
23171 pub target_system: u8,
23172 #[doc = "Component ID (0 for broadcast)."]
23173 pub target_component: u8,
23174 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23176 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23177 pub id_or_mac: [u8; 20],
23178 #[doc = "Indicates the type of the description field."]
23179 pub description_type: MavOdidDescType,
23180 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23181 #[cfg_attr(feature = "ts", ts(type = "string"))]
23182 pub description: CharArray<23>,
23183}
23184impl OPEN_DRONE_ID_SELF_ID_DATA {
23185 pub const ENCODED_LEN: usize = 46usize;
23186 pub const DEFAULT: Self = Self {
23187 target_system: 0_u8,
23188 target_component: 0_u8,
23189 id_or_mac: [0_u8; 20usize],
23190 description_type: MavOdidDescType::DEFAULT,
23191 description: CharArray::new([0_u8; 23usize]),
23192 };
23193 #[cfg(feature = "arbitrary")]
23194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23195 use arbitrary::{Arbitrary, Unstructured};
23196 let mut buf = [0u8; 1024];
23197 rng.fill_bytes(&mut buf);
23198 let mut unstructured = Unstructured::new(&buf);
23199 Self::arbitrary(&mut unstructured).unwrap_or_default()
23200 }
23201}
23202impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
23203 fn default() -> Self {
23204 Self::DEFAULT.clone()
23205 }
23206}
23207impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
23208 type Message = MavMessage;
23209 const ID: u32 = 12903u32;
23210 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
23211 const EXTRA_CRC: u8 = 249u8;
23212 const ENCODED_LEN: usize = 46usize;
23213 fn deser(
23214 _version: MavlinkVersion,
23215 __input: &[u8],
23216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23217 let avail_len = __input.len();
23218 let mut payload_buf = [0; Self::ENCODED_LEN];
23219 let mut buf = if avail_len < Self::ENCODED_LEN {
23220 payload_buf[0..avail_len].copy_from_slice(__input);
23221 Bytes::new(&payload_buf)
23222 } else {
23223 Bytes::new(__input)
23224 };
23225 let mut __struct = Self::default();
23226 __struct.target_system = buf.get_u8()?;
23227 __struct.target_component = buf.get_u8()?;
23228 for v in &mut __struct.id_or_mac {
23229 let val = buf.get_u8()?;
23230 *v = val;
23231 }
23232 let tmp = buf.get_u8()?;
23233 __struct.description_type =
23234 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23235 enum_type: "MavOdidDescType",
23236 value: tmp as u64,
23237 })?;
23238 let mut tmp = [0_u8; 23usize];
23239 for v in &mut tmp {
23240 *v = buf.get_u8()?;
23241 }
23242 __struct.description = CharArray::new(tmp);
23243 Ok(__struct)
23244 }
23245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23246 let mut __tmp = BytesMut::new(bytes);
23247 #[allow(clippy::absurd_extreme_comparisons)]
23248 #[allow(unused_comparisons)]
23249 if __tmp.remaining() < Self::ENCODED_LEN {
23250 panic!(
23251 "buffer is too small (need {} bytes, but got {})",
23252 Self::ENCODED_LEN,
23253 __tmp.remaining(),
23254 )
23255 }
23256 __tmp.put_u8(self.target_system);
23257 __tmp.put_u8(self.target_component);
23258 for val in &self.id_or_mac {
23259 __tmp.put_u8(*val);
23260 }
23261 __tmp.put_u8(self.description_type as u8);
23262 for val in &self.description {
23263 __tmp.put_u8(*val);
23264 }
23265 if matches!(version, MavlinkVersion::V2) {
23266 let len = __tmp.len();
23267 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23268 } else {
23269 __tmp.len()
23270 }
23271 }
23272}
23273#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23274#[doc = ""]
23275#[doc = "ID: 12904"]
23276#[derive(Debug, Clone, PartialEq)]
23277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23279#[cfg_attr(feature = "ts", derive(TS))]
23280#[cfg_attr(feature = "ts", ts(export))]
23281pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23282 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23283 pub operator_latitude: i32,
23284 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23285 pub operator_longitude: i32,
23286 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23287 pub area_ceiling: f32,
23288 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23289 pub area_floor: f32,
23290 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23291 pub operator_altitude_geo: f32,
23292 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23293 pub timestamp: u32,
23294 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23295 pub area_count: u16,
23296 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23297 pub area_radius: u16,
23298 #[doc = "System ID (0 for broadcast)."]
23299 pub target_system: u8,
23300 #[doc = "Component ID (0 for broadcast)."]
23301 pub target_component: u8,
23302 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23303 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23304 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23305 pub id_or_mac: [u8; 20],
23306 #[doc = "Specifies the operator location type."]
23307 pub operator_location_type: MavOdidOperatorLocationType,
23308 #[doc = "Specifies the classification type of the UA."]
23309 pub classification_type: MavOdidClassificationType,
23310 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23311 pub category_eu: MavOdidCategoryEu,
23312 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23313 pub class_eu: MavOdidClassEu,
23314}
23315impl OPEN_DRONE_ID_SYSTEM_DATA {
23316 pub const ENCODED_LEN: usize = 54usize;
23317 pub const DEFAULT: Self = Self {
23318 operator_latitude: 0_i32,
23319 operator_longitude: 0_i32,
23320 area_ceiling: 0.0_f32,
23321 area_floor: 0.0_f32,
23322 operator_altitude_geo: 0.0_f32,
23323 timestamp: 0_u32,
23324 area_count: 0_u16,
23325 area_radius: 0_u16,
23326 target_system: 0_u8,
23327 target_component: 0_u8,
23328 id_or_mac: [0_u8; 20usize],
23329 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23330 classification_type: MavOdidClassificationType::DEFAULT,
23331 category_eu: MavOdidCategoryEu::DEFAULT,
23332 class_eu: MavOdidClassEu::DEFAULT,
23333 };
23334 #[cfg(feature = "arbitrary")]
23335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23336 use arbitrary::{Arbitrary, Unstructured};
23337 let mut buf = [0u8; 1024];
23338 rng.fill_bytes(&mut buf);
23339 let mut unstructured = Unstructured::new(&buf);
23340 Self::arbitrary(&mut unstructured).unwrap_or_default()
23341 }
23342}
23343impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23344 fn default() -> Self {
23345 Self::DEFAULT.clone()
23346 }
23347}
23348impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23349 type Message = MavMessage;
23350 const ID: u32 = 12904u32;
23351 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23352 const EXTRA_CRC: u8 = 77u8;
23353 const ENCODED_LEN: usize = 54usize;
23354 fn deser(
23355 _version: MavlinkVersion,
23356 __input: &[u8],
23357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23358 let avail_len = __input.len();
23359 let mut payload_buf = [0; Self::ENCODED_LEN];
23360 let mut buf = if avail_len < Self::ENCODED_LEN {
23361 payload_buf[0..avail_len].copy_from_slice(__input);
23362 Bytes::new(&payload_buf)
23363 } else {
23364 Bytes::new(__input)
23365 };
23366 let mut __struct = Self::default();
23367 __struct.operator_latitude = buf.get_i32_le()?;
23368 __struct.operator_longitude = buf.get_i32_le()?;
23369 __struct.area_ceiling = buf.get_f32_le()?;
23370 __struct.area_floor = buf.get_f32_le()?;
23371 __struct.operator_altitude_geo = buf.get_f32_le()?;
23372 __struct.timestamp = buf.get_u32_le()?;
23373 __struct.area_count = buf.get_u16_le()?;
23374 __struct.area_radius = buf.get_u16_le()?;
23375 __struct.target_system = buf.get_u8()?;
23376 __struct.target_component = buf.get_u8()?;
23377 for v in &mut __struct.id_or_mac {
23378 let val = buf.get_u8()?;
23379 *v = val;
23380 }
23381 let tmp = buf.get_u8()?;
23382 __struct.operator_location_type =
23383 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23384 enum_type: "MavOdidOperatorLocationType",
23385 value: tmp as u64,
23386 })?;
23387 let tmp = buf.get_u8()?;
23388 __struct.classification_type =
23389 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23390 enum_type: "MavOdidClassificationType",
23391 value: tmp as u64,
23392 })?;
23393 let tmp = buf.get_u8()?;
23394 __struct.category_eu =
23395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23396 enum_type: "MavOdidCategoryEu",
23397 value: tmp as u64,
23398 })?;
23399 let tmp = buf.get_u8()?;
23400 __struct.class_eu =
23401 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23402 enum_type: "MavOdidClassEu",
23403 value: tmp as u64,
23404 })?;
23405 Ok(__struct)
23406 }
23407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23408 let mut __tmp = BytesMut::new(bytes);
23409 #[allow(clippy::absurd_extreme_comparisons)]
23410 #[allow(unused_comparisons)]
23411 if __tmp.remaining() < Self::ENCODED_LEN {
23412 panic!(
23413 "buffer is too small (need {} bytes, but got {})",
23414 Self::ENCODED_LEN,
23415 __tmp.remaining(),
23416 )
23417 }
23418 __tmp.put_i32_le(self.operator_latitude);
23419 __tmp.put_i32_le(self.operator_longitude);
23420 __tmp.put_f32_le(self.area_ceiling);
23421 __tmp.put_f32_le(self.area_floor);
23422 __tmp.put_f32_le(self.operator_altitude_geo);
23423 __tmp.put_u32_le(self.timestamp);
23424 __tmp.put_u16_le(self.area_count);
23425 __tmp.put_u16_le(self.area_radius);
23426 __tmp.put_u8(self.target_system);
23427 __tmp.put_u8(self.target_component);
23428 for val in &self.id_or_mac {
23429 __tmp.put_u8(*val);
23430 }
23431 __tmp.put_u8(self.operator_location_type as u8);
23432 __tmp.put_u8(self.classification_type as u8);
23433 __tmp.put_u8(self.category_eu as u8);
23434 __tmp.put_u8(self.class_eu as u8);
23435 if matches!(version, MavlinkVersion::V2) {
23436 let len = __tmp.len();
23437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23438 } else {
23439 __tmp.len()
23440 }
23441 }
23442}
23443#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23444#[doc = ""]
23445#[doc = "ID: 12919"]
23446#[derive(Debug, Clone, PartialEq)]
23447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23449#[cfg_attr(feature = "ts", derive(TS))]
23450#[cfg_attr(feature = "ts", ts(export))]
23451pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23452 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23453 pub operator_latitude: i32,
23454 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23455 pub operator_longitude: i32,
23456 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23457 pub operator_altitude_geo: f32,
23458 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23459 pub timestamp: u32,
23460 #[doc = "System ID (0 for broadcast)."]
23461 pub target_system: u8,
23462 #[doc = "Component ID (0 for broadcast)."]
23463 pub target_component: u8,
23464}
23465impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23466 pub const ENCODED_LEN: usize = 18usize;
23467 pub const DEFAULT: Self = Self {
23468 operator_latitude: 0_i32,
23469 operator_longitude: 0_i32,
23470 operator_altitude_geo: 0.0_f32,
23471 timestamp: 0_u32,
23472 target_system: 0_u8,
23473 target_component: 0_u8,
23474 };
23475 #[cfg(feature = "arbitrary")]
23476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23477 use arbitrary::{Arbitrary, Unstructured};
23478 let mut buf = [0u8; 1024];
23479 rng.fill_bytes(&mut buf);
23480 let mut unstructured = Unstructured::new(&buf);
23481 Self::arbitrary(&mut unstructured).unwrap_or_default()
23482 }
23483}
23484impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23485 fn default() -> Self {
23486 Self::DEFAULT.clone()
23487 }
23488}
23489impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23490 type Message = MavMessage;
23491 const ID: u32 = 12919u32;
23492 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23493 const EXTRA_CRC: u8 = 7u8;
23494 const ENCODED_LEN: usize = 18usize;
23495 fn deser(
23496 _version: MavlinkVersion,
23497 __input: &[u8],
23498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23499 let avail_len = __input.len();
23500 let mut payload_buf = [0; Self::ENCODED_LEN];
23501 let mut buf = if avail_len < Self::ENCODED_LEN {
23502 payload_buf[0..avail_len].copy_from_slice(__input);
23503 Bytes::new(&payload_buf)
23504 } else {
23505 Bytes::new(__input)
23506 };
23507 let mut __struct = Self::default();
23508 __struct.operator_latitude = buf.get_i32_le()?;
23509 __struct.operator_longitude = buf.get_i32_le()?;
23510 __struct.operator_altitude_geo = buf.get_f32_le()?;
23511 __struct.timestamp = buf.get_u32_le()?;
23512 __struct.target_system = buf.get_u8()?;
23513 __struct.target_component = buf.get_u8()?;
23514 Ok(__struct)
23515 }
23516 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23517 let mut __tmp = BytesMut::new(bytes);
23518 #[allow(clippy::absurd_extreme_comparisons)]
23519 #[allow(unused_comparisons)]
23520 if __tmp.remaining() < Self::ENCODED_LEN {
23521 panic!(
23522 "buffer is too small (need {} bytes, but got {})",
23523 Self::ENCODED_LEN,
23524 __tmp.remaining(),
23525 )
23526 }
23527 __tmp.put_i32_le(self.operator_latitude);
23528 __tmp.put_i32_le(self.operator_longitude);
23529 __tmp.put_f32_le(self.operator_altitude_geo);
23530 __tmp.put_u32_le(self.timestamp);
23531 __tmp.put_u8(self.target_system);
23532 __tmp.put_u8(self.target_component);
23533 if matches!(version, MavlinkVersion::V2) {
23534 let len = __tmp.len();
23535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23536 } else {
23537 __tmp.len()
23538 }
23539 }
23540}
23541#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23542#[doc = ""]
23543#[doc = "ID: 100"]
23544#[derive(Debug, Clone, PartialEq)]
23545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23547#[cfg_attr(feature = "ts", derive(TS))]
23548#[cfg_attr(feature = "ts", ts(export))]
23549pub struct OPTICAL_FLOW_DATA {
23550 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23551 pub time_usec: u64,
23552 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23553 pub flow_comp_m_x: f32,
23554 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23555 pub flow_comp_m_y: f32,
23556 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23557 pub ground_distance: f32,
23558 #[doc = "Flow in x-sensor direction"]
23559 pub flow_x: i16,
23560 #[doc = "Flow in y-sensor direction"]
23561 pub flow_y: i16,
23562 #[doc = "Sensor ID"]
23563 pub sensor_id: u8,
23564 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23565 pub quality: u8,
23566 #[doc = "Flow rate about X axis"]
23567 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23568 pub flow_rate_x: f32,
23569 #[doc = "Flow rate about Y axis"]
23570 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23571 pub flow_rate_y: f32,
23572}
23573impl OPTICAL_FLOW_DATA {
23574 pub const ENCODED_LEN: usize = 34usize;
23575 pub const DEFAULT: Self = Self {
23576 time_usec: 0_u64,
23577 flow_comp_m_x: 0.0_f32,
23578 flow_comp_m_y: 0.0_f32,
23579 ground_distance: 0.0_f32,
23580 flow_x: 0_i16,
23581 flow_y: 0_i16,
23582 sensor_id: 0_u8,
23583 quality: 0_u8,
23584 flow_rate_x: 0.0_f32,
23585 flow_rate_y: 0.0_f32,
23586 };
23587 #[cfg(feature = "arbitrary")]
23588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23589 use arbitrary::{Arbitrary, Unstructured};
23590 let mut buf = [0u8; 1024];
23591 rng.fill_bytes(&mut buf);
23592 let mut unstructured = Unstructured::new(&buf);
23593 Self::arbitrary(&mut unstructured).unwrap_or_default()
23594 }
23595}
23596impl Default for OPTICAL_FLOW_DATA {
23597 fn default() -> Self {
23598 Self::DEFAULT.clone()
23599 }
23600}
23601impl MessageData for OPTICAL_FLOW_DATA {
23602 type Message = MavMessage;
23603 const ID: u32 = 100u32;
23604 const NAME: &'static str = "OPTICAL_FLOW";
23605 const EXTRA_CRC: u8 = 175u8;
23606 const ENCODED_LEN: usize = 34usize;
23607 fn deser(
23608 _version: MavlinkVersion,
23609 __input: &[u8],
23610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23611 let avail_len = __input.len();
23612 let mut payload_buf = [0; Self::ENCODED_LEN];
23613 let mut buf = if avail_len < Self::ENCODED_LEN {
23614 payload_buf[0..avail_len].copy_from_slice(__input);
23615 Bytes::new(&payload_buf)
23616 } else {
23617 Bytes::new(__input)
23618 };
23619 let mut __struct = Self::default();
23620 __struct.time_usec = buf.get_u64_le()?;
23621 __struct.flow_comp_m_x = buf.get_f32_le()?;
23622 __struct.flow_comp_m_y = buf.get_f32_le()?;
23623 __struct.ground_distance = buf.get_f32_le()?;
23624 __struct.flow_x = buf.get_i16_le()?;
23625 __struct.flow_y = buf.get_i16_le()?;
23626 __struct.sensor_id = buf.get_u8()?;
23627 __struct.quality = buf.get_u8()?;
23628 __struct.flow_rate_x = buf.get_f32_le()?;
23629 __struct.flow_rate_y = buf.get_f32_le()?;
23630 Ok(__struct)
23631 }
23632 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23633 let mut __tmp = BytesMut::new(bytes);
23634 #[allow(clippy::absurd_extreme_comparisons)]
23635 #[allow(unused_comparisons)]
23636 if __tmp.remaining() < Self::ENCODED_LEN {
23637 panic!(
23638 "buffer is too small (need {} bytes, but got {})",
23639 Self::ENCODED_LEN,
23640 __tmp.remaining(),
23641 )
23642 }
23643 __tmp.put_u64_le(self.time_usec);
23644 __tmp.put_f32_le(self.flow_comp_m_x);
23645 __tmp.put_f32_le(self.flow_comp_m_y);
23646 __tmp.put_f32_le(self.ground_distance);
23647 __tmp.put_i16_le(self.flow_x);
23648 __tmp.put_i16_le(self.flow_y);
23649 __tmp.put_u8(self.sensor_id);
23650 __tmp.put_u8(self.quality);
23651 if matches!(version, MavlinkVersion::V2) {
23652 __tmp.put_f32_le(self.flow_rate_x);
23653 __tmp.put_f32_le(self.flow_rate_y);
23654 let len = __tmp.len();
23655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23656 } else {
23657 __tmp.len()
23658 }
23659 }
23660}
23661#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23662#[doc = ""]
23663#[doc = "ID: 106"]
23664#[derive(Debug, Clone, PartialEq)]
23665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23667#[cfg_attr(feature = "ts", derive(TS))]
23668#[cfg_attr(feature = "ts", ts(export))]
23669pub struct OPTICAL_FLOW_RAD_DATA {
23670 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23671 pub time_usec: u64,
23672 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23673 pub integration_time_us: u32,
23674 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23675 pub integrated_x: f32,
23676 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23677 pub integrated_y: f32,
23678 #[doc = "RH rotation around X axis"]
23679 pub integrated_xgyro: f32,
23680 #[doc = "RH rotation around Y axis"]
23681 pub integrated_ygyro: f32,
23682 #[doc = "RH rotation around Z axis"]
23683 pub integrated_zgyro: f32,
23684 #[doc = "Time since the distance was sampled."]
23685 pub time_delta_distance_us: u32,
23686 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23687 pub distance: f32,
23688 #[doc = "Temperature"]
23689 pub temperature: i16,
23690 #[doc = "Sensor ID"]
23691 pub sensor_id: u8,
23692 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23693 pub quality: u8,
23694}
23695impl OPTICAL_FLOW_RAD_DATA {
23696 pub const ENCODED_LEN: usize = 44usize;
23697 pub const DEFAULT: Self = Self {
23698 time_usec: 0_u64,
23699 integration_time_us: 0_u32,
23700 integrated_x: 0.0_f32,
23701 integrated_y: 0.0_f32,
23702 integrated_xgyro: 0.0_f32,
23703 integrated_ygyro: 0.0_f32,
23704 integrated_zgyro: 0.0_f32,
23705 time_delta_distance_us: 0_u32,
23706 distance: 0.0_f32,
23707 temperature: 0_i16,
23708 sensor_id: 0_u8,
23709 quality: 0_u8,
23710 };
23711 #[cfg(feature = "arbitrary")]
23712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23713 use arbitrary::{Arbitrary, Unstructured};
23714 let mut buf = [0u8; 1024];
23715 rng.fill_bytes(&mut buf);
23716 let mut unstructured = Unstructured::new(&buf);
23717 Self::arbitrary(&mut unstructured).unwrap_or_default()
23718 }
23719}
23720impl Default for OPTICAL_FLOW_RAD_DATA {
23721 fn default() -> Self {
23722 Self::DEFAULT.clone()
23723 }
23724}
23725impl MessageData for OPTICAL_FLOW_RAD_DATA {
23726 type Message = MavMessage;
23727 const ID: u32 = 106u32;
23728 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23729 const EXTRA_CRC: u8 = 138u8;
23730 const ENCODED_LEN: usize = 44usize;
23731 fn deser(
23732 _version: MavlinkVersion,
23733 __input: &[u8],
23734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23735 let avail_len = __input.len();
23736 let mut payload_buf = [0; Self::ENCODED_LEN];
23737 let mut buf = if avail_len < Self::ENCODED_LEN {
23738 payload_buf[0..avail_len].copy_from_slice(__input);
23739 Bytes::new(&payload_buf)
23740 } else {
23741 Bytes::new(__input)
23742 };
23743 let mut __struct = Self::default();
23744 __struct.time_usec = buf.get_u64_le()?;
23745 __struct.integration_time_us = buf.get_u32_le()?;
23746 __struct.integrated_x = buf.get_f32_le()?;
23747 __struct.integrated_y = buf.get_f32_le()?;
23748 __struct.integrated_xgyro = buf.get_f32_le()?;
23749 __struct.integrated_ygyro = buf.get_f32_le()?;
23750 __struct.integrated_zgyro = buf.get_f32_le()?;
23751 __struct.time_delta_distance_us = buf.get_u32_le()?;
23752 __struct.distance = buf.get_f32_le()?;
23753 __struct.temperature = buf.get_i16_le()?;
23754 __struct.sensor_id = buf.get_u8()?;
23755 __struct.quality = buf.get_u8()?;
23756 Ok(__struct)
23757 }
23758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23759 let mut __tmp = BytesMut::new(bytes);
23760 #[allow(clippy::absurd_extreme_comparisons)]
23761 #[allow(unused_comparisons)]
23762 if __tmp.remaining() < Self::ENCODED_LEN {
23763 panic!(
23764 "buffer is too small (need {} bytes, but got {})",
23765 Self::ENCODED_LEN,
23766 __tmp.remaining(),
23767 )
23768 }
23769 __tmp.put_u64_le(self.time_usec);
23770 __tmp.put_u32_le(self.integration_time_us);
23771 __tmp.put_f32_le(self.integrated_x);
23772 __tmp.put_f32_le(self.integrated_y);
23773 __tmp.put_f32_le(self.integrated_xgyro);
23774 __tmp.put_f32_le(self.integrated_ygyro);
23775 __tmp.put_f32_le(self.integrated_zgyro);
23776 __tmp.put_u32_le(self.time_delta_distance_us);
23777 __tmp.put_f32_le(self.distance);
23778 __tmp.put_i16_le(self.temperature);
23779 __tmp.put_u8(self.sensor_id);
23780 __tmp.put_u8(self.quality);
23781 if matches!(version, MavlinkVersion::V2) {
23782 let len = __tmp.len();
23783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23784 } else {
23785 __tmp.len()
23786 }
23787 }
23788}
23789#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23790#[doc = ""]
23791#[doc = "ID: 360"]
23792#[derive(Debug, Clone, PartialEq)]
23793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23795#[cfg_attr(feature = "ts", derive(TS))]
23796#[cfg_attr(feature = "ts", ts(export))]
23797pub struct ORBIT_EXECUTION_STATUS_DATA {
23798 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23799 pub time_usec: u64,
23800 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23801 pub radius: f32,
23802 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23803 pub x: i32,
23804 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23805 pub y: i32,
23806 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23807 pub z: f32,
23808 #[doc = "The coordinate system of the fields: x, y, z."]
23809 pub frame: MavFrame,
23810}
23811impl ORBIT_EXECUTION_STATUS_DATA {
23812 pub const ENCODED_LEN: usize = 25usize;
23813 pub const DEFAULT: Self = Self {
23814 time_usec: 0_u64,
23815 radius: 0.0_f32,
23816 x: 0_i32,
23817 y: 0_i32,
23818 z: 0.0_f32,
23819 frame: MavFrame::DEFAULT,
23820 };
23821 #[cfg(feature = "arbitrary")]
23822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23823 use arbitrary::{Arbitrary, Unstructured};
23824 let mut buf = [0u8; 1024];
23825 rng.fill_bytes(&mut buf);
23826 let mut unstructured = Unstructured::new(&buf);
23827 Self::arbitrary(&mut unstructured).unwrap_or_default()
23828 }
23829}
23830impl Default for ORBIT_EXECUTION_STATUS_DATA {
23831 fn default() -> Self {
23832 Self::DEFAULT.clone()
23833 }
23834}
23835impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23836 type Message = MavMessage;
23837 const ID: u32 = 360u32;
23838 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23839 const EXTRA_CRC: u8 = 11u8;
23840 const ENCODED_LEN: usize = 25usize;
23841 fn deser(
23842 _version: MavlinkVersion,
23843 __input: &[u8],
23844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23845 let avail_len = __input.len();
23846 let mut payload_buf = [0; Self::ENCODED_LEN];
23847 let mut buf = if avail_len < Self::ENCODED_LEN {
23848 payload_buf[0..avail_len].copy_from_slice(__input);
23849 Bytes::new(&payload_buf)
23850 } else {
23851 Bytes::new(__input)
23852 };
23853 let mut __struct = Self::default();
23854 __struct.time_usec = buf.get_u64_le()?;
23855 __struct.radius = buf.get_f32_le()?;
23856 __struct.x = buf.get_i32_le()?;
23857 __struct.y = buf.get_i32_le()?;
23858 __struct.z = buf.get_f32_le()?;
23859 let tmp = buf.get_u8()?;
23860 __struct.frame =
23861 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23862 enum_type: "MavFrame",
23863 value: tmp as u64,
23864 })?;
23865 Ok(__struct)
23866 }
23867 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23868 let mut __tmp = BytesMut::new(bytes);
23869 #[allow(clippy::absurd_extreme_comparisons)]
23870 #[allow(unused_comparisons)]
23871 if __tmp.remaining() < Self::ENCODED_LEN {
23872 panic!(
23873 "buffer is too small (need {} bytes, but got {})",
23874 Self::ENCODED_LEN,
23875 __tmp.remaining(),
23876 )
23877 }
23878 __tmp.put_u64_le(self.time_usec);
23879 __tmp.put_f32_le(self.radius);
23880 __tmp.put_i32_le(self.x);
23881 __tmp.put_i32_le(self.y);
23882 __tmp.put_f32_le(self.z);
23883 __tmp.put_u8(self.frame as u8);
23884 if matches!(version, MavlinkVersion::V2) {
23885 let len = __tmp.len();
23886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23887 } else {
23888 __tmp.len()
23889 }
23890 }
23891}
23892#[doc = "Response from a PARAM_EXT_SET message."]
23893#[doc = ""]
23894#[doc = "ID: 324"]
23895#[derive(Debug, Clone, PartialEq)]
23896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23898#[cfg_attr(feature = "ts", derive(TS))]
23899#[cfg_attr(feature = "ts", ts(export))]
23900pub struct PARAM_EXT_ACK_DATA {
23901 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23902 #[cfg_attr(feature = "ts", ts(type = "string"))]
23903 pub param_id: CharArray<16>,
23904 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23905 #[cfg_attr(feature = "ts", ts(type = "string"))]
23906 pub param_value: CharArray<128>,
23907 #[doc = "Parameter type."]
23908 pub param_type: MavParamExtType,
23909 #[doc = "Result code."]
23910 pub param_result: ParamAck,
23911}
23912impl PARAM_EXT_ACK_DATA {
23913 pub const ENCODED_LEN: usize = 146usize;
23914 pub const DEFAULT: Self = Self {
23915 param_id: CharArray::new([0_u8; 16usize]),
23916 param_value: CharArray::new([0_u8; 128usize]),
23917 param_type: MavParamExtType::DEFAULT,
23918 param_result: ParamAck::DEFAULT,
23919 };
23920 #[cfg(feature = "arbitrary")]
23921 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23922 use arbitrary::{Arbitrary, Unstructured};
23923 let mut buf = [0u8; 1024];
23924 rng.fill_bytes(&mut buf);
23925 let mut unstructured = Unstructured::new(&buf);
23926 Self::arbitrary(&mut unstructured).unwrap_or_default()
23927 }
23928}
23929impl Default for PARAM_EXT_ACK_DATA {
23930 fn default() -> Self {
23931 Self::DEFAULT.clone()
23932 }
23933}
23934impl MessageData for PARAM_EXT_ACK_DATA {
23935 type Message = MavMessage;
23936 const ID: u32 = 324u32;
23937 const NAME: &'static str = "PARAM_EXT_ACK";
23938 const EXTRA_CRC: u8 = 132u8;
23939 const ENCODED_LEN: usize = 146usize;
23940 fn deser(
23941 _version: MavlinkVersion,
23942 __input: &[u8],
23943 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23944 let avail_len = __input.len();
23945 let mut payload_buf = [0; Self::ENCODED_LEN];
23946 let mut buf = if avail_len < Self::ENCODED_LEN {
23947 payload_buf[0..avail_len].copy_from_slice(__input);
23948 Bytes::new(&payload_buf)
23949 } else {
23950 Bytes::new(__input)
23951 };
23952 let mut __struct = Self::default();
23953 let mut tmp = [0_u8; 16usize];
23954 for v in &mut tmp {
23955 *v = buf.get_u8()?;
23956 }
23957 __struct.param_id = CharArray::new(tmp);
23958 let mut tmp = [0_u8; 128usize];
23959 for v in &mut tmp {
23960 *v = buf.get_u8()?;
23961 }
23962 __struct.param_value = CharArray::new(tmp);
23963 let tmp = buf.get_u8()?;
23964 __struct.param_type =
23965 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23966 enum_type: "MavParamExtType",
23967 value: tmp as u64,
23968 })?;
23969 let tmp = buf.get_u8()?;
23970 __struct.param_result =
23971 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23972 enum_type: "ParamAck",
23973 value: tmp as u64,
23974 })?;
23975 Ok(__struct)
23976 }
23977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23978 let mut __tmp = BytesMut::new(bytes);
23979 #[allow(clippy::absurd_extreme_comparisons)]
23980 #[allow(unused_comparisons)]
23981 if __tmp.remaining() < Self::ENCODED_LEN {
23982 panic!(
23983 "buffer is too small (need {} bytes, but got {})",
23984 Self::ENCODED_LEN,
23985 __tmp.remaining(),
23986 )
23987 }
23988 for val in &self.param_id {
23989 __tmp.put_u8(*val);
23990 }
23991 for val in &self.param_value {
23992 __tmp.put_u8(*val);
23993 }
23994 __tmp.put_u8(self.param_type as u8);
23995 __tmp.put_u8(self.param_result as u8);
23996 if matches!(version, MavlinkVersion::V2) {
23997 let len = __tmp.len();
23998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23999 } else {
24000 __tmp.len()
24001 }
24002 }
24003}
24004#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
24005#[doc = ""]
24006#[doc = "ID: 321"]
24007#[derive(Debug, Clone, PartialEq)]
24008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24010#[cfg_attr(feature = "ts", derive(TS))]
24011#[cfg_attr(feature = "ts", ts(export))]
24012pub struct PARAM_EXT_REQUEST_LIST_DATA {
24013 #[doc = "System ID"]
24014 pub target_system: u8,
24015 #[doc = "Component ID"]
24016 pub target_component: u8,
24017}
24018impl PARAM_EXT_REQUEST_LIST_DATA {
24019 pub const ENCODED_LEN: usize = 2usize;
24020 pub const DEFAULT: Self = Self {
24021 target_system: 0_u8,
24022 target_component: 0_u8,
24023 };
24024 #[cfg(feature = "arbitrary")]
24025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24026 use arbitrary::{Arbitrary, Unstructured};
24027 let mut buf = [0u8; 1024];
24028 rng.fill_bytes(&mut buf);
24029 let mut unstructured = Unstructured::new(&buf);
24030 Self::arbitrary(&mut unstructured).unwrap_or_default()
24031 }
24032}
24033impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24034 fn default() -> Self {
24035 Self::DEFAULT.clone()
24036 }
24037}
24038impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24039 type Message = MavMessage;
24040 const ID: u32 = 321u32;
24041 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24042 const EXTRA_CRC: u8 = 88u8;
24043 const ENCODED_LEN: usize = 2usize;
24044 fn deser(
24045 _version: MavlinkVersion,
24046 __input: &[u8],
24047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24048 let avail_len = __input.len();
24049 let mut payload_buf = [0; Self::ENCODED_LEN];
24050 let mut buf = if avail_len < Self::ENCODED_LEN {
24051 payload_buf[0..avail_len].copy_from_slice(__input);
24052 Bytes::new(&payload_buf)
24053 } else {
24054 Bytes::new(__input)
24055 };
24056 let mut __struct = Self::default();
24057 __struct.target_system = buf.get_u8()?;
24058 __struct.target_component = buf.get_u8()?;
24059 Ok(__struct)
24060 }
24061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24062 let mut __tmp = BytesMut::new(bytes);
24063 #[allow(clippy::absurd_extreme_comparisons)]
24064 #[allow(unused_comparisons)]
24065 if __tmp.remaining() < Self::ENCODED_LEN {
24066 panic!(
24067 "buffer is too small (need {} bytes, but got {})",
24068 Self::ENCODED_LEN,
24069 __tmp.remaining(),
24070 )
24071 }
24072 __tmp.put_u8(self.target_system);
24073 __tmp.put_u8(self.target_component);
24074 if matches!(version, MavlinkVersion::V2) {
24075 let len = __tmp.len();
24076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24077 } else {
24078 __tmp.len()
24079 }
24080 }
24081}
24082#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24083#[doc = ""]
24084#[doc = "ID: 320"]
24085#[derive(Debug, Clone, PartialEq)]
24086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24088#[cfg_attr(feature = "ts", derive(TS))]
24089#[cfg_attr(feature = "ts", ts(export))]
24090pub struct PARAM_EXT_REQUEST_READ_DATA {
24091 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24092 pub param_index: i16,
24093 #[doc = "System ID"]
24094 pub target_system: u8,
24095 #[doc = "Component ID"]
24096 pub target_component: u8,
24097 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24098 #[cfg_attr(feature = "ts", ts(type = "string"))]
24099 pub param_id: CharArray<16>,
24100}
24101impl PARAM_EXT_REQUEST_READ_DATA {
24102 pub const ENCODED_LEN: usize = 20usize;
24103 pub const DEFAULT: Self = Self {
24104 param_index: 0_i16,
24105 target_system: 0_u8,
24106 target_component: 0_u8,
24107 param_id: CharArray::new([0_u8; 16usize]),
24108 };
24109 #[cfg(feature = "arbitrary")]
24110 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24111 use arbitrary::{Arbitrary, Unstructured};
24112 let mut buf = [0u8; 1024];
24113 rng.fill_bytes(&mut buf);
24114 let mut unstructured = Unstructured::new(&buf);
24115 Self::arbitrary(&mut unstructured).unwrap_or_default()
24116 }
24117}
24118impl Default for PARAM_EXT_REQUEST_READ_DATA {
24119 fn default() -> Self {
24120 Self::DEFAULT.clone()
24121 }
24122}
24123impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24124 type Message = MavMessage;
24125 const ID: u32 = 320u32;
24126 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24127 const EXTRA_CRC: u8 = 243u8;
24128 const ENCODED_LEN: usize = 20usize;
24129 fn deser(
24130 _version: MavlinkVersion,
24131 __input: &[u8],
24132 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24133 let avail_len = __input.len();
24134 let mut payload_buf = [0; Self::ENCODED_LEN];
24135 let mut buf = if avail_len < Self::ENCODED_LEN {
24136 payload_buf[0..avail_len].copy_from_slice(__input);
24137 Bytes::new(&payload_buf)
24138 } else {
24139 Bytes::new(__input)
24140 };
24141 let mut __struct = Self::default();
24142 __struct.param_index = buf.get_i16_le()?;
24143 __struct.target_system = buf.get_u8()?;
24144 __struct.target_component = buf.get_u8()?;
24145 let mut tmp = [0_u8; 16usize];
24146 for v in &mut tmp {
24147 *v = buf.get_u8()?;
24148 }
24149 __struct.param_id = CharArray::new(tmp);
24150 Ok(__struct)
24151 }
24152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24153 let mut __tmp = BytesMut::new(bytes);
24154 #[allow(clippy::absurd_extreme_comparisons)]
24155 #[allow(unused_comparisons)]
24156 if __tmp.remaining() < Self::ENCODED_LEN {
24157 panic!(
24158 "buffer is too small (need {} bytes, but got {})",
24159 Self::ENCODED_LEN,
24160 __tmp.remaining(),
24161 )
24162 }
24163 __tmp.put_i16_le(self.param_index);
24164 __tmp.put_u8(self.target_system);
24165 __tmp.put_u8(self.target_component);
24166 for val in &self.param_id {
24167 __tmp.put_u8(*val);
24168 }
24169 if matches!(version, MavlinkVersion::V2) {
24170 let len = __tmp.len();
24171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24172 } else {
24173 __tmp.len()
24174 }
24175 }
24176}
24177#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
24178#[doc = ""]
24179#[doc = "ID: 323"]
24180#[derive(Debug, Clone, PartialEq)]
24181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24183#[cfg_attr(feature = "ts", derive(TS))]
24184#[cfg_attr(feature = "ts", ts(export))]
24185pub struct PARAM_EXT_SET_DATA {
24186 #[doc = "System ID"]
24187 pub target_system: u8,
24188 #[doc = "Component ID"]
24189 pub target_component: u8,
24190 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24191 #[cfg_attr(feature = "ts", ts(type = "string"))]
24192 pub param_id: CharArray<16>,
24193 #[doc = "Parameter value"]
24194 #[cfg_attr(feature = "ts", ts(type = "string"))]
24195 pub param_value: CharArray<128>,
24196 #[doc = "Parameter type."]
24197 pub param_type: MavParamExtType,
24198}
24199impl PARAM_EXT_SET_DATA {
24200 pub const ENCODED_LEN: usize = 147usize;
24201 pub const DEFAULT: Self = Self {
24202 target_system: 0_u8,
24203 target_component: 0_u8,
24204 param_id: CharArray::new([0_u8; 16usize]),
24205 param_value: CharArray::new([0_u8; 128usize]),
24206 param_type: MavParamExtType::DEFAULT,
24207 };
24208 #[cfg(feature = "arbitrary")]
24209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24210 use arbitrary::{Arbitrary, Unstructured};
24211 let mut buf = [0u8; 1024];
24212 rng.fill_bytes(&mut buf);
24213 let mut unstructured = Unstructured::new(&buf);
24214 Self::arbitrary(&mut unstructured).unwrap_or_default()
24215 }
24216}
24217impl Default for PARAM_EXT_SET_DATA {
24218 fn default() -> Self {
24219 Self::DEFAULT.clone()
24220 }
24221}
24222impl MessageData for PARAM_EXT_SET_DATA {
24223 type Message = MavMessage;
24224 const ID: u32 = 323u32;
24225 const NAME: &'static str = "PARAM_EXT_SET";
24226 const EXTRA_CRC: u8 = 78u8;
24227 const ENCODED_LEN: usize = 147usize;
24228 fn deser(
24229 _version: MavlinkVersion,
24230 __input: &[u8],
24231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24232 let avail_len = __input.len();
24233 let mut payload_buf = [0; Self::ENCODED_LEN];
24234 let mut buf = if avail_len < Self::ENCODED_LEN {
24235 payload_buf[0..avail_len].copy_from_slice(__input);
24236 Bytes::new(&payload_buf)
24237 } else {
24238 Bytes::new(__input)
24239 };
24240 let mut __struct = Self::default();
24241 __struct.target_system = buf.get_u8()?;
24242 __struct.target_component = buf.get_u8()?;
24243 let mut tmp = [0_u8; 16usize];
24244 for v in &mut tmp {
24245 *v = buf.get_u8()?;
24246 }
24247 __struct.param_id = CharArray::new(tmp);
24248 let mut tmp = [0_u8; 128usize];
24249 for v in &mut tmp {
24250 *v = buf.get_u8()?;
24251 }
24252 __struct.param_value = CharArray::new(tmp);
24253 let tmp = buf.get_u8()?;
24254 __struct.param_type =
24255 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24256 enum_type: "MavParamExtType",
24257 value: tmp as u64,
24258 })?;
24259 Ok(__struct)
24260 }
24261 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24262 let mut __tmp = BytesMut::new(bytes);
24263 #[allow(clippy::absurd_extreme_comparisons)]
24264 #[allow(unused_comparisons)]
24265 if __tmp.remaining() < Self::ENCODED_LEN {
24266 panic!(
24267 "buffer is too small (need {} bytes, but got {})",
24268 Self::ENCODED_LEN,
24269 __tmp.remaining(),
24270 )
24271 }
24272 __tmp.put_u8(self.target_system);
24273 __tmp.put_u8(self.target_component);
24274 for val in &self.param_id {
24275 __tmp.put_u8(*val);
24276 }
24277 for val in &self.param_value {
24278 __tmp.put_u8(*val);
24279 }
24280 __tmp.put_u8(self.param_type as u8);
24281 if matches!(version, MavlinkVersion::V2) {
24282 let len = __tmp.len();
24283 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24284 } else {
24285 __tmp.len()
24286 }
24287 }
24288}
24289#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24290#[doc = ""]
24291#[doc = "ID: 322"]
24292#[derive(Debug, Clone, PartialEq)]
24293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24295#[cfg_attr(feature = "ts", derive(TS))]
24296#[cfg_attr(feature = "ts", ts(export))]
24297pub struct PARAM_EXT_VALUE_DATA {
24298 #[doc = "Total number of parameters"]
24299 pub param_count: u16,
24300 #[doc = "Index of this parameter"]
24301 pub param_index: u16,
24302 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24303 #[cfg_attr(feature = "ts", ts(type = "string"))]
24304 pub param_id: CharArray<16>,
24305 #[doc = "Parameter value"]
24306 #[cfg_attr(feature = "ts", ts(type = "string"))]
24307 pub param_value: CharArray<128>,
24308 #[doc = "Parameter type."]
24309 pub param_type: MavParamExtType,
24310}
24311impl PARAM_EXT_VALUE_DATA {
24312 pub const ENCODED_LEN: usize = 149usize;
24313 pub const DEFAULT: Self = Self {
24314 param_count: 0_u16,
24315 param_index: 0_u16,
24316 param_id: CharArray::new([0_u8; 16usize]),
24317 param_value: CharArray::new([0_u8; 128usize]),
24318 param_type: MavParamExtType::DEFAULT,
24319 };
24320 #[cfg(feature = "arbitrary")]
24321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24322 use arbitrary::{Arbitrary, Unstructured};
24323 let mut buf = [0u8; 1024];
24324 rng.fill_bytes(&mut buf);
24325 let mut unstructured = Unstructured::new(&buf);
24326 Self::arbitrary(&mut unstructured).unwrap_or_default()
24327 }
24328}
24329impl Default for PARAM_EXT_VALUE_DATA {
24330 fn default() -> Self {
24331 Self::DEFAULT.clone()
24332 }
24333}
24334impl MessageData for PARAM_EXT_VALUE_DATA {
24335 type Message = MavMessage;
24336 const ID: u32 = 322u32;
24337 const NAME: &'static str = "PARAM_EXT_VALUE";
24338 const EXTRA_CRC: u8 = 243u8;
24339 const ENCODED_LEN: usize = 149usize;
24340 fn deser(
24341 _version: MavlinkVersion,
24342 __input: &[u8],
24343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24344 let avail_len = __input.len();
24345 let mut payload_buf = [0; Self::ENCODED_LEN];
24346 let mut buf = if avail_len < Self::ENCODED_LEN {
24347 payload_buf[0..avail_len].copy_from_slice(__input);
24348 Bytes::new(&payload_buf)
24349 } else {
24350 Bytes::new(__input)
24351 };
24352 let mut __struct = Self::default();
24353 __struct.param_count = buf.get_u16_le()?;
24354 __struct.param_index = buf.get_u16_le()?;
24355 let mut tmp = [0_u8; 16usize];
24356 for v in &mut tmp {
24357 *v = buf.get_u8()?;
24358 }
24359 __struct.param_id = CharArray::new(tmp);
24360 let mut tmp = [0_u8; 128usize];
24361 for v in &mut tmp {
24362 *v = buf.get_u8()?;
24363 }
24364 __struct.param_value = CharArray::new(tmp);
24365 let tmp = buf.get_u8()?;
24366 __struct.param_type =
24367 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24368 enum_type: "MavParamExtType",
24369 value: tmp as u64,
24370 })?;
24371 Ok(__struct)
24372 }
24373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24374 let mut __tmp = BytesMut::new(bytes);
24375 #[allow(clippy::absurd_extreme_comparisons)]
24376 #[allow(unused_comparisons)]
24377 if __tmp.remaining() < Self::ENCODED_LEN {
24378 panic!(
24379 "buffer is too small (need {} bytes, but got {})",
24380 Self::ENCODED_LEN,
24381 __tmp.remaining(),
24382 )
24383 }
24384 __tmp.put_u16_le(self.param_count);
24385 __tmp.put_u16_le(self.param_index);
24386 for val in &self.param_id {
24387 __tmp.put_u8(*val);
24388 }
24389 for val in &self.param_value {
24390 __tmp.put_u8(*val);
24391 }
24392 __tmp.put_u8(self.param_type as u8);
24393 if matches!(version, MavlinkVersion::V2) {
24394 let len = __tmp.len();
24395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24396 } else {
24397 __tmp.len()
24398 }
24399 }
24400}
24401#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24402#[doc = ""]
24403#[doc = "ID: 50"]
24404#[derive(Debug, Clone, PartialEq)]
24405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24407#[cfg_attr(feature = "ts", derive(TS))]
24408#[cfg_attr(feature = "ts", ts(export))]
24409pub struct PARAM_MAP_RC_DATA {
24410 #[doc = "Initial parameter value"]
24411 pub param_value0: f32,
24412 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24413 pub scale: f32,
24414 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24415 pub param_value_min: f32,
24416 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24417 pub param_value_max: f32,
24418 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24419 pub param_index: i16,
24420 #[doc = "System ID"]
24421 pub target_system: u8,
24422 #[doc = "Component ID"]
24423 pub target_component: u8,
24424 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24425 #[cfg_attr(feature = "ts", ts(type = "string"))]
24426 pub param_id: CharArray<16>,
24427 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24428 pub parameter_rc_channel_index: u8,
24429}
24430impl PARAM_MAP_RC_DATA {
24431 pub const ENCODED_LEN: usize = 37usize;
24432 pub const DEFAULT: Self = Self {
24433 param_value0: 0.0_f32,
24434 scale: 0.0_f32,
24435 param_value_min: 0.0_f32,
24436 param_value_max: 0.0_f32,
24437 param_index: 0_i16,
24438 target_system: 0_u8,
24439 target_component: 0_u8,
24440 param_id: CharArray::new([0_u8; 16usize]),
24441 parameter_rc_channel_index: 0_u8,
24442 };
24443 #[cfg(feature = "arbitrary")]
24444 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24445 use arbitrary::{Arbitrary, Unstructured};
24446 let mut buf = [0u8; 1024];
24447 rng.fill_bytes(&mut buf);
24448 let mut unstructured = Unstructured::new(&buf);
24449 Self::arbitrary(&mut unstructured).unwrap_or_default()
24450 }
24451}
24452impl Default for PARAM_MAP_RC_DATA {
24453 fn default() -> Self {
24454 Self::DEFAULT.clone()
24455 }
24456}
24457impl MessageData for PARAM_MAP_RC_DATA {
24458 type Message = MavMessage;
24459 const ID: u32 = 50u32;
24460 const NAME: &'static str = "PARAM_MAP_RC";
24461 const EXTRA_CRC: u8 = 78u8;
24462 const ENCODED_LEN: usize = 37usize;
24463 fn deser(
24464 _version: MavlinkVersion,
24465 __input: &[u8],
24466 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24467 let avail_len = __input.len();
24468 let mut payload_buf = [0; Self::ENCODED_LEN];
24469 let mut buf = if avail_len < Self::ENCODED_LEN {
24470 payload_buf[0..avail_len].copy_from_slice(__input);
24471 Bytes::new(&payload_buf)
24472 } else {
24473 Bytes::new(__input)
24474 };
24475 let mut __struct = Self::default();
24476 __struct.param_value0 = buf.get_f32_le()?;
24477 __struct.scale = buf.get_f32_le()?;
24478 __struct.param_value_min = buf.get_f32_le()?;
24479 __struct.param_value_max = buf.get_f32_le()?;
24480 __struct.param_index = buf.get_i16_le()?;
24481 __struct.target_system = buf.get_u8()?;
24482 __struct.target_component = buf.get_u8()?;
24483 let mut tmp = [0_u8; 16usize];
24484 for v in &mut tmp {
24485 *v = buf.get_u8()?;
24486 }
24487 __struct.param_id = CharArray::new(tmp);
24488 __struct.parameter_rc_channel_index = buf.get_u8()?;
24489 Ok(__struct)
24490 }
24491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24492 let mut __tmp = BytesMut::new(bytes);
24493 #[allow(clippy::absurd_extreme_comparisons)]
24494 #[allow(unused_comparisons)]
24495 if __tmp.remaining() < Self::ENCODED_LEN {
24496 panic!(
24497 "buffer is too small (need {} bytes, but got {})",
24498 Self::ENCODED_LEN,
24499 __tmp.remaining(),
24500 )
24501 }
24502 __tmp.put_f32_le(self.param_value0);
24503 __tmp.put_f32_le(self.scale);
24504 __tmp.put_f32_le(self.param_value_min);
24505 __tmp.put_f32_le(self.param_value_max);
24506 __tmp.put_i16_le(self.param_index);
24507 __tmp.put_u8(self.target_system);
24508 __tmp.put_u8(self.target_component);
24509 for val in &self.param_id {
24510 __tmp.put_u8(*val);
24511 }
24512 __tmp.put_u8(self.parameter_rc_channel_index);
24513 if matches!(version, MavlinkVersion::V2) {
24514 let len = __tmp.len();
24515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24516 } else {
24517 __tmp.len()
24518 }
24519 }
24520}
24521#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24522#[doc = ""]
24523#[doc = "ID: 21"]
24524#[derive(Debug, Clone, PartialEq)]
24525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24527#[cfg_attr(feature = "ts", derive(TS))]
24528#[cfg_attr(feature = "ts", ts(export))]
24529pub struct PARAM_REQUEST_LIST_DATA {
24530 #[doc = "System ID"]
24531 pub target_system: u8,
24532 #[doc = "Component ID"]
24533 pub target_component: u8,
24534}
24535impl PARAM_REQUEST_LIST_DATA {
24536 pub const ENCODED_LEN: usize = 2usize;
24537 pub const DEFAULT: Self = Self {
24538 target_system: 0_u8,
24539 target_component: 0_u8,
24540 };
24541 #[cfg(feature = "arbitrary")]
24542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24543 use arbitrary::{Arbitrary, Unstructured};
24544 let mut buf = [0u8; 1024];
24545 rng.fill_bytes(&mut buf);
24546 let mut unstructured = Unstructured::new(&buf);
24547 Self::arbitrary(&mut unstructured).unwrap_or_default()
24548 }
24549}
24550impl Default for PARAM_REQUEST_LIST_DATA {
24551 fn default() -> Self {
24552 Self::DEFAULT.clone()
24553 }
24554}
24555impl MessageData for PARAM_REQUEST_LIST_DATA {
24556 type Message = MavMessage;
24557 const ID: u32 = 21u32;
24558 const NAME: &'static str = "PARAM_REQUEST_LIST";
24559 const EXTRA_CRC: u8 = 159u8;
24560 const ENCODED_LEN: usize = 2usize;
24561 fn deser(
24562 _version: MavlinkVersion,
24563 __input: &[u8],
24564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24565 let avail_len = __input.len();
24566 let mut payload_buf = [0; Self::ENCODED_LEN];
24567 let mut buf = if avail_len < Self::ENCODED_LEN {
24568 payload_buf[0..avail_len].copy_from_slice(__input);
24569 Bytes::new(&payload_buf)
24570 } else {
24571 Bytes::new(__input)
24572 };
24573 let mut __struct = Self::default();
24574 __struct.target_system = buf.get_u8()?;
24575 __struct.target_component = buf.get_u8()?;
24576 Ok(__struct)
24577 }
24578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24579 let mut __tmp = BytesMut::new(bytes);
24580 #[allow(clippy::absurd_extreme_comparisons)]
24581 #[allow(unused_comparisons)]
24582 if __tmp.remaining() < Self::ENCODED_LEN {
24583 panic!(
24584 "buffer is too small (need {} bytes, but got {})",
24585 Self::ENCODED_LEN,
24586 __tmp.remaining(),
24587 )
24588 }
24589 __tmp.put_u8(self.target_system);
24590 __tmp.put_u8(self.target_component);
24591 if matches!(version, MavlinkVersion::V2) {
24592 let len = __tmp.len();
24593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24594 } else {
24595 __tmp.len()
24596 }
24597 }
24598}
24599#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24600#[doc = ""]
24601#[doc = "ID: 20"]
24602#[derive(Debug, Clone, PartialEq)]
24603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24605#[cfg_attr(feature = "ts", derive(TS))]
24606#[cfg_attr(feature = "ts", ts(export))]
24607pub struct PARAM_REQUEST_READ_DATA {
24608 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24609 pub param_index: i16,
24610 #[doc = "System ID"]
24611 pub target_system: u8,
24612 #[doc = "Component ID"]
24613 pub target_component: u8,
24614 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24615 #[cfg_attr(feature = "ts", ts(type = "string"))]
24616 pub param_id: CharArray<16>,
24617}
24618impl PARAM_REQUEST_READ_DATA {
24619 pub const ENCODED_LEN: usize = 20usize;
24620 pub const DEFAULT: Self = Self {
24621 param_index: 0_i16,
24622 target_system: 0_u8,
24623 target_component: 0_u8,
24624 param_id: CharArray::new([0_u8; 16usize]),
24625 };
24626 #[cfg(feature = "arbitrary")]
24627 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24628 use arbitrary::{Arbitrary, Unstructured};
24629 let mut buf = [0u8; 1024];
24630 rng.fill_bytes(&mut buf);
24631 let mut unstructured = Unstructured::new(&buf);
24632 Self::arbitrary(&mut unstructured).unwrap_or_default()
24633 }
24634}
24635impl Default for PARAM_REQUEST_READ_DATA {
24636 fn default() -> Self {
24637 Self::DEFAULT.clone()
24638 }
24639}
24640impl MessageData for PARAM_REQUEST_READ_DATA {
24641 type Message = MavMessage;
24642 const ID: u32 = 20u32;
24643 const NAME: &'static str = "PARAM_REQUEST_READ";
24644 const EXTRA_CRC: u8 = 214u8;
24645 const ENCODED_LEN: usize = 20usize;
24646 fn deser(
24647 _version: MavlinkVersion,
24648 __input: &[u8],
24649 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24650 let avail_len = __input.len();
24651 let mut payload_buf = [0; Self::ENCODED_LEN];
24652 let mut buf = if avail_len < Self::ENCODED_LEN {
24653 payload_buf[0..avail_len].copy_from_slice(__input);
24654 Bytes::new(&payload_buf)
24655 } else {
24656 Bytes::new(__input)
24657 };
24658 let mut __struct = Self::default();
24659 __struct.param_index = buf.get_i16_le()?;
24660 __struct.target_system = buf.get_u8()?;
24661 __struct.target_component = buf.get_u8()?;
24662 let mut tmp = [0_u8; 16usize];
24663 for v in &mut tmp {
24664 *v = buf.get_u8()?;
24665 }
24666 __struct.param_id = CharArray::new(tmp);
24667 Ok(__struct)
24668 }
24669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24670 let mut __tmp = BytesMut::new(bytes);
24671 #[allow(clippy::absurd_extreme_comparisons)]
24672 #[allow(unused_comparisons)]
24673 if __tmp.remaining() < Self::ENCODED_LEN {
24674 panic!(
24675 "buffer is too small (need {} bytes, but got {})",
24676 Self::ENCODED_LEN,
24677 __tmp.remaining(),
24678 )
24679 }
24680 __tmp.put_i16_le(self.param_index);
24681 __tmp.put_u8(self.target_system);
24682 __tmp.put_u8(self.target_component);
24683 for val in &self.param_id {
24684 __tmp.put_u8(*val);
24685 }
24686 if matches!(version, MavlinkVersion::V2) {
24687 let len = __tmp.len();
24688 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24689 } else {
24690 __tmp.len()
24691 }
24692 }
24693}
24694#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24695#[doc = ""]
24696#[doc = "ID: 23"]
24697#[derive(Debug, Clone, PartialEq)]
24698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24700#[cfg_attr(feature = "ts", derive(TS))]
24701#[cfg_attr(feature = "ts", ts(export))]
24702pub struct PARAM_SET_DATA {
24703 #[doc = "Onboard parameter value"]
24704 pub param_value: f32,
24705 #[doc = "System ID"]
24706 pub target_system: u8,
24707 #[doc = "Component ID"]
24708 pub target_component: u8,
24709 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24710 #[cfg_attr(feature = "ts", ts(type = "string"))]
24711 pub param_id: CharArray<16>,
24712 #[doc = "Onboard parameter type."]
24713 pub param_type: MavParamType,
24714}
24715impl PARAM_SET_DATA {
24716 pub const ENCODED_LEN: usize = 23usize;
24717 pub const DEFAULT: Self = Self {
24718 param_value: 0.0_f32,
24719 target_system: 0_u8,
24720 target_component: 0_u8,
24721 param_id: CharArray::new([0_u8; 16usize]),
24722 param_type: MavParamType::DEFAULT,
24723 };
24724 #[cfg(feature = "arbitrary")]
24725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24726 use arbitrary::{Arbitrary, Unstructured};
24727 let mut buf = [0u8; 1024];
24728 rng.fill_bytes(&mut buf);
24729 let mut unstructured = Unstructured::new(&buf);
24730 Self::arbitrary(&mut unstructured).unwrap_or_default()
24731 }
24732}
24733impl Default for PARAM_SET_DATA {
24734 fn default() -> Self {
24735 Self::DEFAULT.clone()
24736 }
24737}
24738impl MessageData for PARAM_SET_DATA {
24739 type Message = MavMessage;
24740 const ID: u32 = 23u32;
24741 const NAME: &'static str = "PARAM_SET";
24742 const EXTRA_CRC: u8 = 168u8;
24743 const ENCODED_LEN: usize = 23usize;
24744 fn deser(
24745 _version: MavlinkVersion,
24746 __input: &[u8],
24747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24748 let avail_len = __input.len();
24749 let mut payload_buf = [0; Self::ENCODED_LEN];
24750 let mut buf = if avail_len < Self::ENCODED_LEN {
24751 payload_buf[0..avail_len].copy_from_slice(__input);
24752 Bytes::new(&payload_buf)
24753 } else {
24754 Bytes::new(__input)
24755 };
24756 let mut __struct = Self::default();
24757 __struct.param_value = buf.get_f32_le()?;
24758 __struct.target_system = buf.get_u8()?;
24759 __struct.target_component = buf.get_u8()?;
24760 let mut tmp = [0_u8; 16usize];
24761 for v in &mut tmp {
24762 *v = buf.get_u8()?;
24763 }
24764 __struct.param_id = CharArray::new(tmp);
24765 let tmp = buf.get_u8()?;
24766 __struct.param_type =
24767 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24768 enum_type: "MavParamType",
24769 value: tmp as u64,
24770 })?;
24771 Ok(__struct)
24772 }
24773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24774 let mut __tmp = BytesMut::new(bytes);
24775 #[allow(clippy::absurd_extreme_comparisons)]
24776 #[allow(unused_comparisons)]
24777 if __tmp.remaining() < Self::ENCODED_LEN {
24778 panic!(
24779 "buffer is too small (need {} bytes, but got {})",
24780 Self::ENCODED_LEN,
24781 __tmp.remaining(),
24782 )
24783 }
24784 __tmp.put_f32_le(self.param_value);
24785 __tmp.put_u8(self.target_system);
24786 __tmp.put_u8(self.target_component);
24787 for val in &self.param_id {
24788 __tmp.put_u8(*val);
24789 }
24790 __tmp.put_u8(self.param_type as u8);
24791 if matches!(version, MavlinkVersion::V2) {
24792 let len = __tmp.len();
24793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24794 } else {
24795 __tmp.len()
24796 }
24797 }
24798}
24799#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24800#[doc = ""]
24801#[doc = "ID: 22"]
24802#[derive(Debug, Clone, PartialEq)]
24803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24805#[cfg_attr(feature = "ts", derive(TS))]
24806#[cfg_attr(feature = "ts", ts(export))]
24807pub struct PARAM_VALUE_DATA {
24808 #[doc = "Onboard parameter value"]
24809 pub param_value: f32,
24810 #[doc = "Total number of onboard parameters"]
24811 pub param_count: u16,
24812 #[doc = "Index of this onboard parameter"]
24813 pub param_index: u16,
24814 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24815 #[cfg_attr(feature = "ts", ts(type = "string"))]
24816 pub param_id: CharArray<16>,
24817 #[doc = "Onboard parameter type."]
24818 pub param_type: MavParamType,
24819}
24820impl PARAM_VALUE_DATA {
24821 pub const ENCODED_LEN: usize = 25usize;
24822 pub const DEFAULT: Self = Self {
24823 param_value: 0.0_f32,
24824 param_count: 0_u16,
24825 param_index: 0_u16,
24826 param_id: CharArray::new([0_u8; 16usize]),
24827 param_type: MavParamType::DEFAULT,
24828 };
24829 #[cfg(feature = "arbitrary")]
24830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24831 use arbitrary::{Arbitrary, Unstructured};
24832 let mut buf = [0u8; 1024];
24833 rng.fill_bytes(&mut buf);
24834 let mut unstructured = Unstructured::new(&buf);
24835 Self::arbitrary(&mut unstructured).unwrap_or_default()
24836 }
24837}
24838impl Default for PARAM_VALUE_DATA {
24839 fn default() -> Self {
24840 Self::DEFAULT.clone()
24841 }
24842}
24843impl MessageData for PARAM_VALUE_DATA {
24844 type Message = MavMessage;
24845 const ID: u32 = 22u32;
24846 const NAME: &'static str = "PARAM_VALUE";
24847 const EXTRA_CRC: u8 = 220u8;
24848 const ENCODED_LEN: usize = 25usize;
24849 fn deser(
24850 _version: MavlinkVersion,
24851 __input: &[u8],
24852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24853 let avail_len = __input.len();
24854 let mut payload_buf = [0; Self::ENCODED_LEN];
24855 let mut buf = if avail_len < Self::ENCODED_LEN {
24856 payload_buf[0..avail_len].copy_from_slice(__input);
24857 Bytes::new(&payload_buf)
24858 } else {
24859 Bytes::new(__input)
24860 };
24861 let mut __struct = Self::default();
24862 __struct.param_value = buf.get_f32_le()?;
24863 __struct.param_count = buf.get_u16_le()?;
24864 __struct.param_index = buf.get_u16_le()?;
24865 let mut tmp = [0_u8; 16usize];
24866 for v in &mut tmp {
24867 *v = buf.get_u8()?;
24868 }
24869 __struct.param_id = CharArray::new(tmp);
24870 let tmp = buf.get_u8()?;
24871 __struct.param_type =
24872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24873 enum_type: "MavParamType",
24874 value: tmp as u64,
24875 })?;
24876 Ok(__struct)
24877 }
24878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24879 let mut __tmp = BytesMut::new(bytes);
24880 #[allow(clippy::absurd_extreme_comparisons)]
24881 #[allow(unused_comparisons)]
24882 if __tmp.remaining() < Self::ENCODED_LEN {
24883 panic!(
24884 "buffer is too small (need {} bytes, but got {})",
24885 Self::ENCODED_LEN,
24886 __tmp.remaining(),
24887 )
24888 }
24889 __tmp.put_f32_le(self.param_value);
24890 __tmp.put_u16_le(self.param_count);
24891 __tmp.put_u16_le(self.param_index);
24892 for val in &self.param_id {
24893 __tmp.put_u8(*val);
24894 }
24895 __tmp.put_u8(self.param_type as u8);
24896 if matches!(version, MavlinkVersion::V2) {
24897 let len = __tmp.len();
24898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24899 } else {
24900 __tmp.len()
24901 }
24902 }
24903}
24904#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24905#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24906#[doc = ""]
24907#[doc = "ID: 4"]
24908#[derive(Debug, Clone, PartialEq)]
24909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24911#[cfg_attr(feature = "ts", derive(TS))]
24912#[cfg_attr(feature = "ts", ts(export))]
24913pub struct PING_DATA {
24914 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24915 pub time_usec: u64,
24916 #[doc = "PING sequence"]
24917 pub seq: u32,
24918 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24919 pub target_system: u8,
24920 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24921 pub target_component: u8,
24922}
24923impl PING_DATA {
24924 pub const ENCODED_LEN: usize = 14usize;
24925 pub const DEFAULT: Self = Self {
24926 time_usec: 0_u64,
24927 seq: 0_u32,
24928 target_system: 0_u8,
24929 target_component: 0_u8,
24930 };
24931 #[cfg(feature = "arbitrary")]
24932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24933 use arbitrary::{Arbitrary, Unstructured};
24934 let mut buf = [0u8; 1024];
24935 rng.fill_bytes(&mut buf);
24936 let mut unstructured = Unstructured::new(&buf);
24937 Self::arbitrary(&mut unstructured).unwrap_or_default()
24938 }
24939}
24940impl Default for PING_DATA {
24941 fn default() -> Self {
24942 Self::DEFAULT.clone()
24943 }
24944}
24945impl MessageData for PING_DATA {
24946 type Message = MavMessage;
24947 const ID: u32 = 4u32;
24948 const NAME: &'static str = "PING";
24949 const EXTRA_CRC: u8 = 237u8;
24950 const ENCODED_LEN: usize = 14usize;
24951 fn deser(
24952 _version: MavlinkVersion,
24953 __input: &[u8],
24954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24955 let avail_len = __input.len();
24956 let mut payload_buf = [0; Self::ENCODED_LEN];
24957 let mut buf = if avail_len < Self::ENCODED_LEN {
24958 payload_buf[0..avail_len].copy_from_slice(__input);
24959 Bytes::new(&payload_buf)
24960 } else {
24961 Bytes::new(__input)
24962 };
24963 let mut __struct = Self::default();
24964 __struct.time_usec = buf.get_u64_le()?;
24965 __struct.seq = buf.get_u32_le()?;
24966 __struct.target_system = buf.get_u8()?;
24967 __struct.target_component = buf.get_u8()?;
24968 Ok(__struct)
24969 }
24970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24971 let mut __tmp = BytesMut::new(bytes);
24972 #[allow(clippy::absurd_extreme_comparisons)]
24973 #[allow(unused_comparisons)]
24974 if __tmp.remaining() < Self::ENCODED_LEN {
24975 panic!(
24976 "buffer is too small (need {} bytes, but got {})",
24977 Self::ENCODED_LEN,
24978 __tmp.remaining(),
24979 )
24980 }
24981 __tmp.put_u64_le(self.time_usec);
24982 __tmp.put_u32_le(self.seq);
24983 __tmp.put_u8(self.target_system);
24984 __tmp.put_u8(self.target_component);
24985 if matches!(version, MavlinkVersion::V2) {
24986 let len = __tmp.len();
24987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24988 } else {
24989 __tmp.len()
24990 }
24991 }
24992}
24993#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24994#[doc = "Control vehicle tone generation (buzzer)."]
24995#[doc = ""]
24996#[doc = "ID: 258"]
24997#[derive(Debug, Clone, PartialEq)]
24998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25000#[cfg_attr(feature = "ts", derive(TS))]
25001#[cfg_attr(feature = "ts", ts(export))]
25002pub struct PLAY_TUNE_DATA {
25003 #[doc = "System ID"]
25004 pub target_system: u8,
25005 #[doc = "Component ID"]
25006 pub target_component: u8,
25007 #[doc = "tune in board specific format"]
25008 #[cfg_attr(feature = "ts", ts(type = "string"))]
25009 pub tune: CharArray<30>,
25010 #[doc = "tune extension (appended to tune)"]
25011 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25012 #[cfg_attr(feature = "ts", ts(type = "string"))]
25013 pub tune2: CharArray<200>,
25014}
25015impl PLAY_TUNE_DATA {
25016 pub const ENCODED_LEN: usize = 232usize;
25017 pub const DEFAULT: Self = Self {
25018 target_system: 0_u8,
25019 target_component: 0_u8,
25020 tune: CharArray::new([0_u8; 30usize]),
25021 tune2: CharArray::new([0_u8; 200usize]),
25022 };
25023 #[cfg(feature = "arbitrary")]
25024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25025 use arbitrary::{Arbitrary, Unstructured};
25026 let mut buf = [0u8; 1024];
25027 rng.fill_bytes(&mut buf);
25028 let mut unstructured = Unstructured::new(&buf);
25029 Self::arbitrary(&mut unstructured).unwrap_or_default()
25030 }
25031}
25032impl Default for PLAY_TUNE_DATA {
25033 fn default() -> Self {
25034 Self::DEFAULT.clone()
25035 }
25036}
25037impl MessageData for PLAY_TUNE_DATA {
25038 type Message = MavMessage;
25039 const ID: u32 = 258u32;
25040 const NAME: &'static str = "PLAY_TUNE";
25041 const EXTRA_CRC: u8 = 187u8;
25042 const ENCODED_LEN: usize = 232usize;
25043 fn deser(
25044 _version: MavlinkVersion,
25045 __input: &[u8],
25046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25047 let avail_len = __input.len();
25048 let mut payload_buf = [0; Self::ENCODED_LEN];
25049 let mut buf = if avail_len < Self::ENCODED_LEN {
25050 payload_buf[0..avail_len].copy_from_slice(__input);
25051 Bytes::new(&payload_buf)
25052 } else {
25053 Bytes::new(__input)
25054 };
25055 let mut __struct = Self::default();
25056 __struct.target_system = buf.get_u8()?;
25057 __struct.target_component = buf.get_u8()?;
25058 let mut tmp = [0_u8; 30usize];
25059 for v in &mut tmp {
25060 *v = buf.get_u8()?;
25061 }
25062 __struct.tune = CharArray::new(tmp);
25063 let mut tmp = [0_u8; 200usize];
25064 for v in &mut tmp {
25065 *v = buf.get_u8()?;
25066 }
25067 __struct.tune2 = CharArray::new(tmp);
25068 Ok(__struct)
25069 }
25070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25071 let mut __tmp = BytesMut::new(bytes);
25072 #[allow(clippy::absurd_extreme_comparisons)]
25073 #[allow(unused_comparisons)]
25074 if __tmp.remaining() < Self::ENCODED_LEN {
25075 panic!(
25076 "buffer is too small (need {} bytes, but got {})",
25077 Self::ENCODED_LEN,
25078 __tmp.remaining(),
25079 )
25080 }
25081 __tmp.put_u8(self.target_system);
25082 __tmp.put_u8(self.target_component);
25083 for val in &self.tune {
25084 __tmp.put_u8(*val);
25085 }
25086 if matches!(version, MavlinkVersion::V2) {
25087 for val in &self.tune2 {
25088 __tmp.put_u8(*val);
25089 }
25090 let len = __tmp.len();
25091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25092 } else {
25093 __tmp.len()
25094 }
25095 }
25096}
25097#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25098#[doc = ""]
25099#[doc = "ID: 400"]
25100#[derive(Debug, Clone, PartialEq)]
25101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25103#[cfg_attr(feature = "ts", derive(TS))]
25104#[cfg_attr(feature = "ts", ts(export))]
25105pub struct PLAY_TUNE_V2_DATA {
25106 #[doc = "Tune format"]
25107 pub format: TuneFormat,
25108 #[doc = "System ID"]
25109 pub target_system: u8,
25110 #[doc = "Component ID"]
25111 pub target_component: u8,
25112 #[doc = "Tune definition as a NULL-terminated string."]
25113 #[cfg_attr(feature = "ts", ts(type = "string"))]
25114 pub tune: CharArray<248>,
25115}
25116impl PLAY_TUNE_V2_DATA {
25117 pub const ENCODED_LEN: usize = 254usize;
25118 pub const DEFAULT: Self = Self {
25119 format: TuneFormat::DEFAULT,
25120 target_system: 0_u8,
25121 target_component: 0_u8,
25122 tune: CharArray::new([0_u8; 248usize]),
25123 };
25124 #[cfg(feature = "arbitrary")]
25125 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25126 use arbitrary::{Arbitrary, Unstructured};
25127 let mut buf = [0u8; 1024];
25128 rng.fill_bytes(&mut buf);
25129 let mut unstructured = Unstructured::new(&buf);
25130 Self::arbitrary(&mut unstructured).unwrap_or_default()
25131 }
25132}
25133impl Default for PLAY_TUNE_V2_DATA {
25134 fn default() -> Self {
25135 Self::DEFAULT.clone()
25136 }
25137}
25138impl MessageData for PLAY_TUNE_V2_DATA {
25139 type Message = MavMessage;
25140 const ID: u32 = 400u32;
25141 const NAME: &'static str = "PLAY_TUNE_V2";
25142 const EXTRA_CRC: u8 = 110u8;
25143 const ENCODED_LEN: usize = 254usize;
25144 fn deser(
25145 _version: MavlinkVersion,
25146 __input: &[u8],
25147 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25148 let avail_len = __input.len();
25149 let mut payload_buf = [0; Self::ENCODED_LEN];
25150 let mut buf = if avail_len < Self::ENCODED_LEN {
25151 payload_buf[0..avail_len].copy_from_slice(__input);
25152 Bytes::new(&payload_buf)
25153 } else {
25154 Bytes::new(__input)
25155 };
25156 let mut __struct = Self::default();
25157 let tmp = buf.get_u32_le()?;
25158 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25159 ::mavlink_core::error::ParserError::InvalidEnum {
25160 enum_type: "TuneFormat",
25161 value: tmp as u64,
25162 },
25163 )?;
25164 __struct.target_system = buf.get_u8()?;
25165 __struct.target_component = buf.get_u8()?;
25166 let mut tmp = [0_u8; 248usize];
25167 for v in &mut tmp {
25168 *v = buf.get_u8()?;
25169 }
25170 __struct.tune = CharArray::new(tmp);
25171 Ok(__struct)
25172 }
25173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25174 let mut __tmp = BytesMut::new(bytes);
25175 #[allow(clippy::absurd_extreme_comparisons)]
25176 #[allow(unused_comparisons)]
25177 if __tmp.remaining() < Self::ENCODED_LEN {
25178 panic!(
25179 "buffer is too small (need {} bytes, but got {})",
25180 Self::ENCODED_LEN,
25181 __tmp.remaining(),
25182 )
25183 }
25184 __tmp.put_u32_le(self.format as u32);
25185 __tmp.put_u8(self.target_system);
25186 __tmp.put_u8(self.target_component);
25187 for val in &self.tune {
25188 __tmp.put_u8(*val);
25189 }
25190 if matches!(version, MavlinkVersion::V2) {
25191 let len = __tmp.len();
25192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25193 } else {
25194 __tmp.len()
25195 }
25196 }
25197}
25198#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25199#[doc = ""]
25200#[doc = "ID: 87"]
25201#[derive(Debug, Clone, PartialEq)]
25202#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25204#[cfg_attr(feature = "ts", derive(TS))]
25205#[cfg_attr(feature = "ts", ts(export))]
25206pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25207 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25208 pub time_boot_ms: u32,
25209 #[doc = "Latitude in WGS84 frame"]
25210 pub lat_int: i32,
25211 #[doc = "Longitude in WGS84 frame"]
25212 pub lon_int: i32,
25213 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25214 pub alt: f32,
25215 #[doc = "X velocity in NED frame"]
25216 pub vx: f32,
25217 #[doc = "Y velocity in NED frame"]
25218 pub vy: f32,
25219 #[doc = "Z velocity in NED frame"]
25220 pub vz: f32,
25221 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25222 pub afx: f32,
25223 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25224 pub afy: f32,
25225 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25226 pub afz: f32,
25227 #[doc = "yaw setpoint"]
25228 pub yaw: f32,
25229 #[doc = "yaw rate setpoint"]
25230 pub yaw_rate: f32,
25231 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25232 pub type_mask: PositionTargetTypemask,
25233 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25234 pub coordinate_frame: MavFrame,
25235}
25236impl POSITION_TARGET_GLOBAL_INT_DATA {
25237 pub const ENCODED_LEN: usize = 51usize;
25238 pub const DEFAULT: Self = Self {
25239 time_boot_ms: 0_u32,
25240 lat_int: 0_i32,
25241 lon_int: 0_i32,
25242 alt: 0.0_f32,
25243 vx: 0.0_f32,
25244 vy: 0.0_f32,
25245 vz: 0.0_f32,
25246 afx: 0.0_f32,
25247 afy: 0.0_f32,
25248 afz: 0.0_f32,
25249 yaw: 0.0_f32,
25250 yaw_rate: 0.0_f32,
25251 type_mask: PositionTargetTypemask::DEFAULT,
25252 coordinate_frame: MavFrame::DEFAULT,
25253 };
25254 #[cfg(feature = "arbitrary")]
25255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25256 use arbitrary::{Arbitrary, Unstructured};
25257 let mut buf = [0u8; 1024];
25258 rng.fill_bytes(&mut buf);
25259 let mut unstructured = Unstructured::new(&buf);
25260 Self::arbitrary(&mut unstructured).unwrap_or_default()
25261 }
25262}
25263impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25264 fn default() -> Self {
25265 Self::DEFAULT.clone()
25266 }
25267}
25268impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25269 type Message = MavMessage;
25270 const ID: u32 = 87u32;
25271 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25272 const EXTRA_CRC: u8 = 150u8;
25273 const ENCODED_LEN: usize = 51usize;
25274 fn deser(
25275 _version: MavlinkVersion,
25276 __input: &[u8],
25277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25278 let avail_len = __input.len();
25279 let mut payload_buf = [0; Self::ENCODED_LEN];
25280 let mut buf = if avail_len < Self::ENCODED_LEN {
25281 payload_buf[0..avail_len].copy_from_slice(__input);
25282 Bytes::new(&payload_buf)
25283 } else {
25284 Bytes::new(__input)
25285 };
25286 let mut __struct = Self::default();
25287 __struct.time_boot_ms = buf.get_u32_le()?;
25288 __struct.lat_int = buf.get_i32_le()?;
25289 __struct.lon_int = buf.get_i32_le()?;
25290 __struct.alt = buf.get_f32_le()?;
25291 __struct.vx = buf.get_f32_le()?;
25292 __struct.vy = buf.get_f32_le()?;
25293 __struct.vz = buf.get_f32_le()?;
25294 __struct.afx = buf.get_f32_le()?;
25295 __struct.afy = buf.get_f32_le()?;
25296 __struct.afz = buf.get_f32_le()?;
25297 __struct.yaw = buf.get_f32_le()?;
25298 __struct.yaw_rate = buf.get_f32_le()?;
25299 let tmp = buf.get_u16_le()?;
25300 __struct.type_mask =
25301 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25302 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25303 flag_type: "PositionTargetTypemask",
25304 value: tmp as u64,
25305 })?;
25306 let tmp = buf.get_u8()?;
25307 __struct.coordinate_frame =
25308 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25309 enum_type: "MavFrame",
25310 value: tmp as u64,
25311 })?;
25312 Ok(__struct)
25313 }
25314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25315 let mut __tmp = BytesMut::new(bytes);
25316 #[allow(clippy::absurd_extreme_comparisons)]
25317 #[allow(unused_comparisons)]
25318 if __tmp.remaining() < Self::ENCODED_LEN {
25319 panic!(
25320 "buffer is too small (need {} bytes, but got {})",
25321 Self::ENCODED_LEN,
25322 __tmp.remaining(),
25323 )
25324 }
25325 __tmp.put_u32_le(self.time_boot_ms);
25326 __tmp.put_i32_le(self.lat_int);
25327 __tmp.put_i32_le(self.lon_int);
25328 __tmp.put_f32_le(self.alt);
25329 __tmp.put_f32_le(self.vx);
25330 __tmp.put_f32_le(self.vy);
25331 __tmp.put_f32_le(self.vz);
25332 __tmp.put_f32_le(self.afx);
25333 __tmp.put_f32_le(self.afy);
25334 __tmp.put_f32_le(self.afz);
25335 __tmp.put_f32_le(self.yaw);
25336 __tmp.put_f32_le(self.yaw_rate);
25337 __tmp.put_u16_le(self.type_mask.bits() as u16);
25338 __tmp.put_u8(self.coordinate_frame as u8);
25339 if matches!(version, MavlinkVersion::V2) {
25340 let len = __tmp.len();
25341 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25342 } else {
25343 __tmp.len()
25344 }
25345 }
25346}
25347#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25348#[doc = ""]
25349#[doc = "ID: 85"]
25350#[derive(Debug, Clone, PartialEq)]
25351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25353#[cfg_attr(feature = "ts", derive(TS))]
25354#[cfg_attr(feature = "ts", ts(export))]
25355pub struct POSITION_TARGET_LOCAL_NED_DATA {
25356 #[doc = "Timestamp (time since system boot)."]
25357 pub time_boot_ms: u32,
25358 #[doc = "X Position in NED frame"]
25359 pub x: f32,
25360 #[doc = "Y Position in NED frame"]
25361 pub y: f32,
25362 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25363 pub z: f32,
25364 #[doc = "X velocity in NED frame"]
25365 pub vx: f32,
25366 #[doc = "Y velocity in NED frame"]
25367 pub vy: f32,
25368 #[doc = "Z velocity in NED frame"]
25369 pub vz: f32,
25370 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25371 pub afx: f32,
25372 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25373 pub afy: f32,
25374 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25375 pub afz: f32,
25376 #[doc = "yaw setpoint"]
25377 pub yaw: f32,
25378 #[doc = "yaw rate setpoint"]
25379 pub yaw_rate: f32,
25380 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25381 pub type_mask: PositionTargetTypemask,
25382 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25383 pub coordinate_frame: MavFrame,
25384}
25385impl POSITION_TARGET_LOCAL_NED_DATA {
25386 pub const ENCODED_LEN: usize = 51usize;
25387 pub const DEFAULT: Self = Self {
25388 time_boot_ms: 0_u32,
25389 x: 0.0_f32,
25390 y: 0.0_f32,
25391 z: 0.0_f32,
25392 vx: 0.0_f32,
25393 vy: 0.0_f32,
25394 vz: 0.0_f32,
25395 afx: 0.0_f32,
25396 afy: 0.0_f32,
25397 afz: 0.0_f32,
25398 yaw: 0.0_f32,
25399 yaw_rate: 0.0_f32,
25400 type_mask: PositionTargetTypemask::DEFAULT,
25401 coordinate_frame: MavFrame::DEFAULT,
25402 };
25403 #[cfg(feature = "arbitrary")]
25404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25405 use arbitrary::{Arbitrary, Unstructured};
25406 let mut buf = [0u8; 1024];
25407 rng.fill_bytes(&mut buf);
25408 let mut unstructured = Unstructured::new(&buf);
25409 Self::arbitrary(&mut unstructured).unwrap_or_default()
25410 }
25411}
25412impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25413 fn default() -> Self {
25414 Self::DEFAULT.clone()
25415 }
25416}
25417impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25418 type Message = MavMessage;
25419 const ID: u32 = 85u32;
25420 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25421 const EXTRA_CRC: u8 = 140u8;
25422 const ENCODED_LEN: usize = 51usize;
25423 fn deser(
25424 _version: MavlinkVersion,
25425 __input: &[u8],
25426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25427 let avail_len = __input.len();
25428 let mut payload_buf = [0; Self::ENCODED_LEN];
25429 let mut buf = if avail_len < Self::ENCODED_LEN {
25430 payload_buf[0..avail_len].copy_from_slice(__input);
25431 Bytes::new(&payload_buf)
25432 } else {
25433 Bytes::new(__input)
25434 };
25435 let mut __struct = Self::default();
25436 __struct.time_boot_ms = buf.get_u32_le()?;
25437 __struct.x = buf.get_f32_le()?;
25438 __struct.y = buf.get_f32_le()?;
25439 __struct.z = buf.get_f32_le()?;
25440 __struct.vx = buf.get_f32_le()?;
25441 __struct.vy = buf.get_f32_le()?;
25442 __struct.vz = buf.get_f32_le()?;
25443 __struct.afx = buf.get_f32_le()?;
25444 __struct.afy = buf.get_f32_le()?;
25445 __struct.afz = buf.get_f32_le()?;
25446 __struct.yaw = buf.get_f32_le()?;
25447 __struct.yaw_rate = buf.get_f32_le()?;
25448 let tmp = buf.get_u16_le()?;
25449 __struct.type_mask =
25450 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25451 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25452 flag_type: "PositionTargetTypemask",
25453 value: tmp as u64,
25454 })?;
25455 let tmp = buf.get_u8()?;
25456 __struct.coordinate_frame =
25457 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25458 enum_type: "MavFrame",
25459 value: tmp as u64,
25460 })?;
25461 Ok(__struct)
25462 }
25463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25464 let mut __tmp = BytesMut::new(bytes);
25465 #[allow(clippy::absurd_extreme_comparisons)]
25466 #[allow(unused_comparisons)]
25467 if __tmp.remaining() < Self::ENCODED_LEN {
25468 panic!(
25469 "buffer is too small (need {} bytes, but got {})",
25470 Self::ENCODED_LEN,
25471 __tmp.remaining(),
25472 )
25473 }
25474 __tmp.put_u32_le(self.time_boot_ms);
25475 __tmp.put_f32_le(self.x);
25476 __tmp.put_f32_le(self.y);
25477 __tmp.put_f32_le(self.z);
25478 __tmp.put_f32_le(self.vx);
25479 __tmp.put_f32_le(self.vy);
25480 __tmp.put_f32_le(self.vz);
25481 __tmp.put_f32_le(self.afx);
25482 __tmp.put_f32_le(self.afy);
25483 __tmp.put_f32_le(self.afz);
25484 __tmp.put_f32_le(self.yaw);
25485 __tmp.put_f32_le(self.yaw_rate);
25486 __tmp.put_u16_le(self.type_mask.bits() as u16);
25487 __tmp.put_u8(self.coordinate_frame as u8);
25488 if matches!(version, MavlinkVersion::V2) {
25489 let len = __tmp.len();
25490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25491 } else {
25492 __tmp.len()
25493 }
25494 }
25495}
25496#[doc = "Power supply status."]
25497#[doc = ""]
25498#[doc = "ID: 125"]
25499#[derive(Debug, Clone, PartialEq)]
25500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25502#[cfg_attr(feature = "ts", derive(TS))]
25503#[cfg_attr(feature = "ts", ts(export))]
25504pub struct POWER_STATUS_DATA {
25505 #[doc = "5V rail voltage."]
25506 pub Vcc: u16,
25507 #[doc = "Servo rail voltage."]
25508 pub Vservo: u16,
25509 #[doc = "Bitmap of power supply status flags."]
25510 pub flags: MavPowerStatus,
25511}
25512impl POWER_STATUS_DATA {
25513 pub const ENCODED_LEN: usize = 6usize;
25514 pub const DEFAULT: Self = Self {
25515 Vcc: 0_u16,
25516 Vservo: 0_u16,
25517 flags: MavPowerStatus::DEFAULT,
25518 };
25519 #[cfg(feature = "arbitrary")]
25520 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25521 use arbitrary::{Arbitrary, Unstructured};
25522 let mut buf = [0u8; 1024];
25523 rng.fill_bytes(&mut buf);
25524 let mut unstructured = Unstructured::new(&buf);
25525 Self::arbitrary(&mut unstructured).unwrap_or_default()
25526 }
25527}
25528impl Default for POWER_STATUS_DATA {
25529 fn default() -> Self {
25530 Self::DEFAULT.clone()
25531 }
25532}
25533impl MessageData for POWER_STATUS_DATA {
25534 type Message = MavMessage;
25535 const ID: u32 = 125u32;
25536 const NAME: &'static str = "POWER_STATUS";
25537 const EXTRA_CRC: u8 = 203u8;
25538 const ENCODED_LEN: usize = 6usize;
25539 fn deser(
25540 _version: MavlinkVersion,
25541 __input: &[u8],
25542 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25543 let avail_len = __input.len();
25544 let mut payload_buf = [0; Self::ENCODED_LEN];
25545 let mut buf = if avail_len < Self::ENCODED_LEN {
25546 payload_buf[0..avail_len].copy_from_slice(__input);
25547 Bytes::new(&payload_buf)
25548 } else {
25549 Bytes::new(__input)
25550 };
25551 let mut __struct = Self::default();
25552 __struct.Vcc = buf.get_u16_le()?;
25553 __struct.Vservo = buf.get_u16_le()?;
25554 let tmp = buf.get_u16_le()?;
25555 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
25556 ::mavlink_core::error::ParserError::InvalidFlag {
25557 flag_type: "MavPowerStatus",
25558 value: tmp as u64,
25559 },
25560 )?;
25561 Ok(__struct)
25562 }
25563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25564 let mut __tmp = BytesMut::new(bytes);
25565 #[allow(clippy::absurd_extreme_comparisons)]
25566 #[allow(unused_comparisons)]
25567 if __tmp.remaining() < Self::ENCODED_LEN {
25568 panic!(
25569 "buffer is too small (need {} bytes, but got {})",
25570 Self::ENCODED_LEN,
25571 __tmp.remaining(),
25572 )
25573 }
25574 __tmp.put_u16_le(self.Vcc);
25575 __tmp.put_u16_le(self.Vservo);
25576 __tmp.put_u16_le(self.flags.bits() as u16);
25577 if matches!(version, MavlinkVersion::V2) {
25578 let len = __tmp.len();
25579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25580 } else {
25581 __tmp.len()
25582 }
25583 }
25584}
25585#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25586#[doc = ""]
25587#[doc = "ID: 300"]
25588#[derive(Debug, Clone, PartialEq)]
25589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25591#[cfg_attr(feature = "ts", derive(TS))]
25592#[cfg_attr(feature = "ts", ts(export))]
25593pub struct PROTOCOL_VERSION_DATA {
25594 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25595 pub version: u16,
25596 #[doc = "Minimum MAVLink version supported"]
25597 pub min_version: u16,
25598 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25599 pub max_version: u16,
25600 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25602 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25603 pub spec_version_hash: [u8; 8],
25604 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25606 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25607 pub library_version_hash: [u8; 8],
25608}
25609impl PROTOCOL_VERSION_DATA {
25610 pub const ENCODED_LEN: usize = 22usize;
25611 pub const DEFAULT: Self = Self {
25612 version: 0_u16,
25613 min_version: 0_u16,
25614 max_version: 0_u16,
25615 spec_version_hash: [0_u8; 8usize],
25616 library_version_hash: [0_u8; 8usize],
25617 };
25618 #[cfg(feature = "arbitrary")]
25619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25620 use arbitrary::{Arbitrary, Unstructured};
25621 let mut buf = [0u8; 1024];
25622 rng.fill_bytes(&mut buf);
25623 let mut unstructured = Unstructured::new(&buf);
25624 Self::arbitrary(&mut unstructured).unwrap_or_default()
25625 }
25626}
25627impl Default for PROTOCOL_VERSION_DATA {
25628 fn default() -> Self {
25629 Self::DEFAULT.clone()
25630 }
25631}
25632impl MessageData for PROTOCOL_VERSION_DATA {
25633 type Message = MavMessage;
25634 const ID: u32 = 300u32;
25635 const NAME: &'static str = "PROTOCOL_VERSION";
25636 const EXTRA_CRC: u8 = 217u8;
25637 const ENCODED_LEN: usize = 22usize;
25638 fn deser(
25639 _version: MavlinkVersion,
25640 __input: &[u8],
25641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25642 let avail_len = __input.len();
25643 let mut payload_buf = [0; Self::ENCODED_LEN];
25644 let mut buf = if avail_len < Self::ENCODED_LEN {
25645 payload_buf[0..avail_len].copy_from_slice(__input);
25646 Bytes::new(&payload_buf)
25647 } else {
25648 Bytes::new(__input)
25649 };
25650 let mut __struct = Self::default();
25651 __struct.version = buf.get_u16_le()?;
25652 __struct.min_version = buf.get_u16_le()?;
25653 __struct.max_version = buf.get_u16_le()?;
25654 for v in &mut __struct.spec_version_hash {
25655 let val = buf.get_u8()?;
25656 *v = val;
25657 }
25658 for v in &mut __struct.library_version_hash {
25659 let val = buf.get_u8()?;
25660 *v = val;
25661 }
25662 Ok(__struct)
25663 }
25664 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25665 let mut __tmp = BytesMut::new(bytes);
25666 #[allow(clippy::absurd_extreme_comparisons)]
25667 #[allow(unused_comparisons)]
25668 if __tmp.remaining() < Self::ENCODED_LEN {
25669 panic!(
25670 "buffer is too small (need {} bytes, but got {})",
25671 Self::ENCODED_LEN,
25672 __tmp.remaining(),
25673 )
25674 }
25675 __tmp.put_u16_le(self.version);
25676 __tmp.put_u16_le(self.min_version);
25677 __tmp.put_u16_le(self.max_version);
25678 for val in &self.spec_version_hash {
25679 __tmp.put_u8(*val);
25680 }
25681 for val in &self.library_version_hash {
25682 __tmp.put_u8(*val);
25683 }
25684 if matches!(version, MavlinkVersion::V2) {
25685 let len = __tmp.len();
25686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25687 } else {
25688 __tmp.len()
25689 }
25690 }
25691}
25692#[doc = "RC channel outputs from a MAVLink RC receiver for input to a flight controller or other components (allows an RC receiver to connect via MAVLink instead of some other protocol such as PPM-Sum or S.BUS). Note that this is not intended to be an over-the-air format, and does not replace RC_CHANNELS and similar messages reported by the flight controller. The target_system field should normally be set to the system id of the system to control, typically the flight controller. The target_component field can normally be set to 0, so that all components of the system can receive the message. The channels array field can publish up to 32 channels; the number of channel items used in the array is specified in the count field. The time_last_update_ms field contains the timestamp of the last received valid channels data in the receiver's time domain. The count field indicates the first index of the channel array that is not used for channel data (this and later indexes are zero-filled). The RADIO_RC_CHANNELS_FLAGS_OUTDATED flag is set by the receiver if the channels data is not up-to-date (for example, if new data from the transmitter could not be validated so the last valid data is resent). The RADIO_RC_CHANNELS_FLAGS_FAILSAFE failsafe flag is set by the receiver if the receiver's failsafe condition is met (implementation dependent, e.g., connection to the RC radio is lost). In this case time_last_update_ms still contains the timestamp of the last valid channels data, but the content of the channels data is not defined by the protocol (it is up to the implementation of the receiver). For instance, the channels data could contain failsafe values configured in the receiver; the default is to carry the last valid data. Note: The RC channels fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming."]
25693#[doc = ""]
25694#[doc = "ID: 420"]
25695#[derive(Debug, Clone, PartialEq)]
25696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25698#[cfg_attr(feature = "ts", derive(TS))]
25699#[cfg_attr(feature = "ts", ts(export))]
25700pub struct RADIO_RC_CHANNELS_DATA {
25701 #[doc = "Time when the data in the channels field were last updated (time since boot in the receiver's time domain)."]
25702 pub time_last_update_ms: u32,
25703 #[doc = "Radio RC channels status flags."]
25704 pub flags: RadioRcChannelsFlags,
25705 #[doc = "System ID (ID of target system, normally flight controller)."]
25706 pub target_system: u8,
25707 #[doc = "Component ID (normally 0 for broadcast)."]
25708 pub target_component: u8,
25709 #[doc = "Total number of RC channels being received. This can be larger than 32, indicating that more channels are available but not given in this message."]
25710 pub count: u8,
25711 #[doc = "RC channels. Channel values are in centered 13 bit format. Range is -4096 to 4096, center is 0. Conversion to PWM is x * 5/32 + 1500. Channels with indexes equal or above count should be set to 0, to benefit from MAVLink's trailing-zero trimming."]
25712 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25713 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25714 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25715 pub channels: [i16; 32],
25716}
25717impl RADIO_RC_CHANNELS_DATA {
25718 pub const ENCODED_LEN: usize = 73usize;
25719 pub const DEFAULT: Self = Self {
25720 time_last_update_ms: 0_u32,
25721 flags: RadioRcChannelsFlags::DEFAULT,
25722 target_system: 0_u8,
25723 target_component: 0_u8,
25724 count: 0_u8,
25725 channels: [0_i16; 32usize],
25726 };
25727 #[cfg(feature = "arbitrary")]
25728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25729 use arbitrary::{Arbitrary, Unstructured};
25730 let mut buf = [0u8; 1024];
25731 rng.fill_bytes(&mut buf);
25732 let mut unstructured = Unstructured::new(&buf);
25733 Self::arbitrary(&mut unstructured).unwrap_or_default()
25734 }
25735}
25736impl Default for RADIO_RC_CHANNELS_DATA {
25737 fn default() -> Self {
25738 Self::DEFAULT.clone()
25739 }
25740}
25741impl MessageData for RADIO_RC_CHANNELS_DATA {
25742 type Message = MavMessage;
25743 const ID: u32 = 420u32;
25744 const NAME: &'static str = "RADIO_RC_CHANNELS";
25745 const EXTRA_CRC: u8 = 20u8;
25746 const ENCODED_LEN: usize = 73usize;
25747 fn deser(
25748 _version: MavlinkVersion,
25749 __input: &[u8],
25750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25751 let avail_len = __input.len();
25752 let mut payload_buf = [0; Self::ENCODED_LEN];
25753 let mut buf = if avail_len < Self::ENCODED_LEN {
25754 payload_buf[0..avail_len].copy_from_slice(__input);
25755 Bytes::new(&payload_buf)
25756 } else {
25757 Bytes::new(__input)
25758 };
25759 let mut __struct = Self::default();
25760 __struct.time_last_update_ms = buf.get_u32_le()?;
25761 let tmp = buf.get_u16_le()?;
25762 __struct.flags = RadioRcChannelsFlags::from_bits(
25763 tmp as <RadioRcChannelsFlags as Flags>::Bits,
25764 )
25765 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25766 flag_type: "RadioRcChannelsFlags",
25767 value: tmp as u64,
25768 })?;
25769 __struct.target_system = buf.get_u8()?;
25770 __struct.target_component = buf.get_u8()?;
25771 __struct.count = buf.get_u8()?;
25772 for v in &mut __struct.channels {
25773 let val = buf.get_i16_le()?;
25774 *v = val;
25775 }
25776 Ok(__struct)
25777 }
25778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25779 let mut __tmp = BytesMut::new(bytes);
25780 #[allow(clippy::absurd_extreme_comparisons)]
25781 #[allow(unused_comparisons)]
25782 if __tmp.remaining() < Self::ENCODED_LEN {
25783 panic!(
25784 "buffer is too small (need {} bytes, but got {})",
25785 Self::ENCODED_LEN,
25786 __tmp.remaining(),
25787 )
25788 }
25789 __tmp.put_u32_le(self.time_last_update_ms);
25790 __tmp.put_u16_le(self.flags.bits() as u16);
25791 __tmp.put_u8(self.target_system);
25792 __tmp.put_u8(self.target_component);
25793 __tmp.put_u8(self.count);
25794 if matches!(version, MavlinkVersion::V2) {
25795 for val in &self.channels {
25796 __tmp.put_i16_le(*val);
25797 }
25798 let len = __tmp.len();
25799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25800 } else {
25801 __tmp.len()
25802 }
25803 }
25804}
25805#[doc = "Status generated by radio and injected into MAVLink stream."]
25806#[doc = ""]
25807#[doc = "ID: 109"]
25808#[derive(Debug, Clone, PartialEq)]
25809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25811#[cfg_attr(feature = "ts", derive(TS))]
25812#[cfg_attr(feature = "ts", ts(export))]
25813pub struct RADIO_STATUS_DATA {
25814 #[doc = "Count of radio packet receive errors (since boot)."]
25815 pub rxerrors: u16,
25816 #[doc = "Count of error corrected radio packets (since boot)."]
25817 pub fixed: u16,
25818 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25819 pub rssi: u8,
25820 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25821 pub remrssi: u8,
25822 #[doc = "Remaining free transmitter buffer space."]
25823 pub txbuf: u8,
25824 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25825 pub noise: u8,
25826 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25827 pub remnoise: u8,
25828}
25829impl RADIO_STATUS_DATA {
25830 pub const ENCODED_LEN: usize = 9usize;
25831 pub const DEFAULT: Self = Self {
25832 rxerrors: 0_u16,
25833 fixed: 0_u16,
25834 rssi: 0_u8,
25835 remrssi: 0_u8,
25836 txbuf: 0_u8,
25837 noise: 0_u8,
25838 remnoise: 0_u8,
25839 };
25840 #[cfg(feature = "arbitrary")]
25841 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25842 use arbitrary::{Arbitrary, Unstructured};
25843 let mut buf = [0u8; 1024];
25844 rng.fill_bytes(&mut buf);
25845 let mut unstructured = Unstructured::new(&buf);
25846 Self::arbitrary(&mut unstructured).unwrap_or_default()
25847 }
25848}
25849impl Default for RADIO_STATUS_DATA {
25850 fn default() -> Self {
25851 Self::DEFAULT.clone()
25852 }
25853}
25854impl MessageData for RADIO_STATUS_DATA {
25855 type Message = MavMessage;
25856 const ID: u32 = 109u32;
25857 const NAME: &'static str = "RADIO_STATUS";
25858 const EXTRA_CRC: u8 = 185u8;
25859 const ENCODED_LEN: usize = 9usize;
25860 fn deser(
25861 _version: MavlinkVersion,
25862 __input: &[u8],
25863 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25864 let avail_len = __input.len();
25865 let mut payload_buf = [0; Self::ENCODED_LEN];
25866 let mut buf = if avail_len < Self::ENCODED_LEN {
25867 payload_buf[0..avail_len].copy_from_slice(__input);
25868 Bytes::new(&payload_buf)
25869 } else {
25870 Bytes::new(__input)
25871 };
25872 let mut __struct = Self::default();
25873 __struct.rxerrors = buf.get_u16_le()?;
25874 __struct.fixed = buf.get_u16_le()?;
25875 __struct.rssi = buf.get_u8()?;
25876 __struct.remrssi = buf.get_u8()?;
25877 __struct.txbuf = buf.get_u8()?;
25878 __struct.noise = buf.get_u8()?;
25879 __struct.remnoise = buf.get_u8()?;
25880 Ok(__struct)
25881 }
25882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25883 let mut __tmp = BytesMut::new(bytes);
25884 #[allow(clippy::absurd_extreme_comparisons)]
25885 #[allow(unused_comparisons)]
25886 if __tmp.remaining() < Self::ENCODED_LEN {
25887 panic!(
25888 "buffer is too small (need {} bytes, but got {})",
25889 Self::ENCODED_LEN,
25890 __tmp.remaining(),
25891 )
25892 }
25893 __tmp.put_u16_le(self.rxerrors);
25894 __tmp.put_u16_le(self.fixed);
25895 __tmp.put_u8(self.rssi);
25896 __tmp.put_u8(self.remrssi);
25897 __tmp.put_u8(self.txbuf);
25898 __tmp.put_u8(self.noise);
25899 __tmp.put_u8(self.remnoise);
25900 if matches!(version, MavlinkVersion::V2) {
25901 let len = __tmp.len();
25902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25903 } else {
25904 __tmp.len()
25905 }
25906 }
25907}
25908#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25909#[doc = ""]
25910#[doc = "ID: 27"]
25911#[derive(Debug, Clone, PartialEq)]
25912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25914#[cfg_attr(feature = "ts", derive(TS))]
25915#[cfg_attr(feature = "ts", ts(export))]
25916pub struct RAW_IMU_DATA {
25917 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25918 pub time_usec: u64,
25919 #[doc = "X acceleration (raw)"]
25920 pub xacc: i16,
25921 #[doc = "Y acceleration (raw)"]
25922 pub yacc: i16,
25923 #[doc = "Z acceleration (raw)"]
25924 pub zacc: i16,
25925 #[doc = "Angular speed around X axis (raw)"]
25926 pub xgyro: i16,
25927 #[doc = "Angular speed around Y axis (raw)"]
25928 pub ygyro: i16,
25929 #[doc = "Angular speed around Z axis (raw)"]
25930 pub zgyro: i16,
25931 #[doc = "X Magnetic field (raw)"]
25932 pub xmag: i16,
25933 #[doc = "Y Magnetic field (raw)"]
25934 pub ymag: i16,
25935 #[doc = "Z Magnetic field (raw)"]
25936 pub zmag: i16,
25937 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25938 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25939 pub id: u8,
25940 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25941 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25942 pub temperature: i16,
25943}
25944impl RAW_IMU_DATA {
25945 pub const ENCODED_LEN: usize = 29usize;
25946 pub const DEFAULT: Self = Self {
25947 time_usec: 0_u64,
25948 xacc: 0_i16,
25949 yacc: 0_i16,
25950 zacc: 0_i16,
25951 xgyro: 0_i16,
25952 ygyro: 0_i16,
25953 zgyro: 0_i16,
25954 xmag: 0_i16,
25955 ymag: 0_i16,
25956 zmag: 0_i16,
25957 id: 0_u8,
25958 temperature: 0_i16,
25959 };
25960 #[cfg(feature = "arbitrary")]
25961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25962 use arbitrary::{Arbitrary, Unstructured};
25963 let mut buf = [0u8; 1024];
25964 rng.fill_bytes(&mut buf);
25965 let mut unstructured = Unstructured::new(&buf);
25966 Self::arbitrary(&mut unstructured).unwrap_or_default()
25967 }
25968}
25969impl Default for RAW_IMU_DATA {
25970 fn default() -> Self {
25971 Self::DEFAULT.clone()
25972 }
25973}
25974impl MessageData for RAW_IMU_DATA {
25975 type Message = MavMessage;
25976 const ID: u32 = 27u32;
25977 const NAME: &'static str = "RAW_IMU";
25978 const EXTRA_CRC: u8 = 144u8;
25979 const ENCODED_LEN: usize = 29usize;
25980 fn deser(
25981 _version: MavlinkVersion,
25982 __input: &[u8],
25983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25984 let avail_len = __input.len();
25985 let mut payload_buf = [0; Self::ENCODED_LEN];
25986 let mut buf = if avail_len < Self::ENCODED_LEN {
25987 payload_buf[0..avail_len].copy_from_slice(__input);
25988 Bytes::new(&payload_buf)
25989 } else {
25990 Bytes::new(__input)
25991 };
25992 let mut __struct = Self::default();
25993 __struct.time_usec = buf.get_u64_le()?;
25994 __struct.xacc = buf.get_i16_le()?;
25995 __struct.yacc = buf.get_i16_le()?;
25996 __struct.zacc = buf.get_i16_le()?;
25997 __struct.xgyro = buf.get_i16_le()?;
25998 __struct.ygyro = buf.get_i16_le()?;
25999 __struct.zgyro = buf.get_i16_le()?;
26000 __struct.xmag = buf.get_i16_le()?;
26001 __struct.ymag = buf.get_i16_le()?;
26002 __struct.zmag = buf.get_i16_le()?;
26003 __struct.id = buf.get_u8()?;
26004 __struct.temperature = buf.get_i16_le()?;
26005 Ok(__struct)
26006 }
26007 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26008 let mut __tmp = BytesMut::new(bytes);
26009 #[allow(clippy::absurd_extreme_comparisons)]
26010 #[allow(unused_comparisons)]
26011 if __tmp.remaining() < Self::ENCODED_LEN {
26012 panic!(
26013 "buffer is too small (need {} bytes, but got {})",
26014 Self::ENCODED_LEN,
26015 __tmp.remaining(),
26016 )
26017 }
26018 __tmp.put_u64_le(self.time_usec);
26019 __tmp.put_i16_le(self.xacc);
26020 __tmp.put_i16_le(self.yacc);
26021 __tmp.put_i16_le(self.zacc);
26022 __tmp.put_i16_le(self.xgyro);
26023 __tmp.put_i16_le(self.ygyro);
26024 __tmp.put_i16_le(self.zgyro);
26025 __tmp.put_i16_le(self.xmag);
26026 __tmp.put_i16_le(self.ymag);
26027 __tmp.put_i16_le(self.zmag);
26028 if matches!(version, MavlinkVersion::V2) {
26029 __tmp.put_u8(self.id);
26030 __tmp.put_i16_le(self.temperature);
26031 let len = __tmp.len();
26032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26033 } else {
26034 __tmp.len()
26035 }
26036 }
26037}
26038#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
26039#[doc = ""]
26040#[doc = "ID: 28"]
26041#[derive(Debug, Clone, PartialEq)]
26042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26044#[cfg_attr(feature = "ts", derive(TS))]
26045#[cfg_attr(feature = "ts", ts(export))]
26046pub struct RAW_PRESSURE_DATA {
26047 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26048 pub time_usec: u64,
26049 #[doc = "Absolute pressure (raw)"]
26050 pub press_abs: i16,
26051 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
26052 pub press_diff1: i16,
26053 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
26054 pub press_diff2: i16,
26055 #[doc = "Raw Temperature measurement (raw)"]
26056 pub temperature: i16,
26057}
26058impl RAW_PRESSURE_DATA {
26059 pub const ENCODED_LEN: usize = 16usize;
26060 pub const DEFAULT: Self = Self {
26061 time_usec: 0_u64,
26062 press_abs: 0_i16,
26063 press_diff1: 0_i16,
26064 press_diff2: 0_i16,
26065 temperature: 0_i16,
26066 };
26067 #[cfg(feature = "arbitrary")]
26068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26069 use arbitrary::{Arbitrary, Unstructured};
26070 let mut buf = [0u8; 1024];
26071 rng.fill_bytes(&mut buf);
26072 let mut unstructured = Unstructured::new(&buf);
26073 Self::arbitrary(&mut unstructured).unwrap_or_default()
26074 }
26075}
26076impl Default for RAW_PRESSURE_DATA {
26077 fn default() -> Self {
26078 Self::DEFAULT.clone()
26079 }
26080}
26081impl MessageData for RAW_PRESSURE_DATA {
26082 type Message = MavMessage;
26083 const ID: u32 = 28u32;
26084 const NAME: &'static str = "RAW_PRESSURE";
26085 const EXTRA_CRC: u8 = 67u8;
26086 const ENCODED_LEN: usize = 16usize;
26087 fn deser(
26088 _version: MavlinkVersion,
26089 __input: &[u8],
26090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26091 let avail_len = __input.len();
26092 let mut payload_buf = [0; Self::ENCODED_LEN];
26093 let mut buf = if avail_len < Self::ENCODED_LEN {
26094 payload_buf[0..avail_len].copy_from_slice(__input);
26095 Bytes::new(&payload_buf)
26096 } else {
26097 Bytes::new(__input)
26098 };
26099 let mut __struct = Self::default();
26100 __struct.time_usec = buf.get_u64_le()?;
26101 __struct.press_abs = buf.get_i16_le()?;
26102 __struct.press_diff1 = buf.get_i16_le()?;
26103 __struct.press_diff2 = buf.get_i16_le()?;
26104 __struct.temperature = buf.get_i16_le()?;
26105 Ok(__struct)
26106 }
26107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26108 let mut __tmp = BytesMut::new(bytes);
26109 #[allow(clippy::absurd_extreme_comparisons)]
26110 #[allow(unused_comparisons)]
26111 if __tmp.remaining() < Self::ENCODED_LEN {
26112 panic!(
26113 "buffer is too small (need {} bytes, but got {})",
26114 Self::ENCODED_LEN,
26115 __tmp.remaining(),
26116 )
26117 }
26118 __tmp.put_u64_le(self.time_usec);
26119 __tmp.put_i16_le(self.press_abs);
26120 __tmp.put_i16_le(self.press_diff1);
26121 __tmp.put_i16_le(self.press_diff2);
26122 __tmp.put_i16_le(self.temperature);
26123 if matches!(version, MavlinkVersion::V2) {
26124 let len = __tmp.len();
26125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26126 } else {
26127 __tmp.len()
26128 }
26129 }
26130}
26131#[doc = "RPM sensor data message."]
26132#[doc = ""]
26133#[doc = "ID: 339"]
26134#[derive(Debug, Clone, PartialEq)]
26135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26137#[cfg_attr(feature = "ts", derive(TS))]
26138#[cfg_attr(feature = "ts", ts(export))]
26139pub struct RAW_RPM_DATA {
26140 #[doc = "Indicated rate"]
26141 pub frequency: f32,
26142 #[doc = "Index of this RPM sensor (0-indexed)"]
26143 pub index: u8,
26144}
26145impl RAW_RPM_DATA {
26146 pub const ENCODED_LEN: usize = 5usize;
26147 pub const DEFAULT: Self = Self {
26148 frequency: 0.0_f32,
26149 index: 0_u8,
26150 };
26151 #[cfg(feature = "arbitrary")]
26152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26153 use arbitrary::{Arbitrary, Unstructured};
26154 let mut buf = [0u8; 1024];
26155 rng.fill_bytes(&mut buf);
26156 let mut unstructured = Unstructured::new(&buf);
26157 Self::arbitrary(&mut unstructured).unwrap_or_default()
26158 }
26159}
26160impl Default for RAW_RPM_DATA {
26161 fn default() -> Self {
26162 Self::DEFAULT.clone()
26163 }
26164}
26165impl MessageData for RAW_RPM_DATA {
26166 type Message = MavMessage;
26167 const ID: u32 = 339u32;
26168 const NAME: &'static str = "RAW_RPM";
26169 const EXTRA_CRC: u8 = 199u8;
26170 const ENCODED_LEN: usize = 5usize;
26171 fn deser(
26172 _version: MavlinkVersion,
26173 __input: &[u8],
26174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26175 let avail_len = __input.len();
26176 let mut payload_buf = [0; Self::ENCODED_LEN];
26177 let mut buf = if avail_len < Self::ENCODED_LEN {
26178 payload_buf[0..avail_len].copy_from_slice(__input);
26179 Bytes::new(&payload_buf)
26180 } else {
26181 Bytes::new(__input)
26182 };
26183 let mut __struct = Self::default();
26184 __struct.frequency = buf.get_f32_le()?;
26185 __struct.index = buf.get_u8()?;
26186 Ok(__struct)
26187 }
26188 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26189 let mut __tmp = BytesMut::new(bytes);
26190 #[allow(clippy::absurd_extreme_comparisons)]
26191 #[allow(unused_comparisons)]
26192 if __tmp.remaining() < Self::ENCODED_LEN {
26193 panic!(
26194 "buffer is too small (need {} bytes, but got {})",
26195 Self::ENCODED_LEN,
26196 __tmp.remaining(),
26197 )
26198 }
26199 __tmp.put_f32_le(self.frequency);
26200 __tmp.put_u8(self.index);
26201 if matches!(version, MavlinkVersion::V2) {
26202 let len = __tmp.len();
26203 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26204 } else {
26205 __tmp.len()
26206 }
26207 }
26208}
26209#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26210#[doc = ""]
26211#[doc = "ID: 65"]
26212#[derive(Debug, Clone, PartialEq)]
26213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26215#[cfg_attr(feature = "ts", derive(TS))]
26216#[cfg_attr(feature = "ts", ts(export))]
26217pub struct RC_CHANNELS_DATA {
26218 #[doc = "Timestamp (time since system boot)."]
26219 pub time_boot_ms: u32,
26220 #[doc = "RC channel 1 value."]
26221 pub chan1_raw: u16,
26222 #[doc = "RC channel 2 value."]
26223 pub chan2_raw: u16,
26224 #[doc = "RC channel 3 value."]
26225 pub chan3_raw: u16,
26226 #[doc = "RC channel 4 value."]
26227 pub chan4_raw: u16,
26228 #[doc = "RC channel 5 value."]
26229 pub chan5_raw: u16,
26230 #[doc = "RC channel 6 value."]
26231 pub chan6_raw: u16,
26232 #[doc = "RC channel 7 value."]
26233 pub chan7_raw: u16,
26234 #[doc = "RC channel 8 value."]
26235 pub chan8_raw: u16,
26236 #[doc = "RC channel 9 value."]
26237 pub chan9_raw: u16,
26238 #[doc = "RC channel 10 value."]
26239 pub chan10_raw: u16,
26240 #[doc = "RC channel 11 value."]
26241 pub chan11_raw: u16,
26242 #[doc = "RC channel 12 value."]
26243 pub chan12_raw: u16,
26244 #[doc = "RC channel 13 value."]
26245 pub chan13_raw: u16,
26246 #[doc = "RC channel 14 value."]
26247 pub chan14_raw: u16,
26248 #[doc = "RC channel 15 value."]
26249 pub chan15_raw: u16,
26250 #[doc = "RC channel 16 value."]
26251 pub chan16_raw: u16,
26252 #[doc = "RC channel 17 value."]
26253 pub chan17_raw: u16,
26254 #[doc = "RC channel 18 value."]
26255 pub chan18_raw: u16,
26256 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
26257 pub chancount: u8,
26258 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26259 pub rssi: u8,
26260}
26261impl RC_CHANNELS_DATA {
26262 pub const ENCODED_LEN: usize = 42usize;
26263 pub const DEFAULT: Self = Self {
26264 time_boot_ms: 0_u32,
26265 chan1_raw: 0_u16,
26266 chan2_raw: 0_u16,
26267 chan3_raw: 0_u16,
26268 chan4_raw: 0_u16,
26269 chan5_raw: 0_u16,
26270 chan6_raw: 0_u16,
26271 chan7_raw: 0_u16,
26272 chan8_raw: 0_u16,
26273 chan9_raw: 0_u16,
26274 chan10_raw: 0_u16,
26275 chan11_raw: 0_u16,
26276 chan12_raw: 0_u16,
26277 chan13_raw: 0_u16,
26278 chan14_raw: 0_u16,
26279 chan15_raw: 0_u16,
26280 chan16_raw: 0_u16,
26281 chan17_raw: 0_u16,
26282 chan18_raw: 0_u16,
26283 chancount: 0_u8,
26284 rssi: 0_u8,
26285 };
26286 #[cfg(feature = "arbitrary")]
26287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26288 use arbitrary::{Arbitrary, Unstructured};
26289 let mut buf = [0u8; 1024];
26290 rng.fill_bytes(&mut buf);
26291 let mut unstructured = Unstructured::new(&buf);
26292 Self::arbitrary(&mut unstructured).unwrap_or_default()
26293 }
26294}
26295impl Default for RC_CHANNELS_DATA {
26296 fn default() -> Self {
26297 Self::DEFAULT.clone()
26298 }
26299}
26300impl MessageData for RC_CHANNELS_DATA {
26301 type Message = MavMessage;
26302 const ID: u32 = 65u32;
26303 const NAME: &'static str = "RC_CHANNELS";
26304 const EXTRA_CRC: u8 = 118u8;
26305 const ENCODED_LEN: usize = 42usize;
26306 fn deser(
26307 _version: MavlinkVersion,
26308 __input: &[u8],
26309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26310 let avail_len = __input.len();
26311 let mut payload_buf = [0; Self::ENCODED_LEN];
26312 let mut buf = if avail_len < Self::ENCODED_LEN {
26313 payload_buf[0..avail_len].copy_from_slice(__input);
26314 Bytes::new(&payload_buf)
26315 } else {
26316 Bytes::new(__input)
26317 };
26318 let mut __struct = Self::default();
26319 __struct.time_boot_ms = buf.get_u32_le()?;
26320 __struct.chan1_raw = buf.get_u16_le()?;
26321 __struct.chan2_raw = buf.get_u16_le()?;
26322 __struct.chan3_raw = buf.get_u16_le()?;
26323 __struct.chan4_raw = buf.get_u16_le()?;
26324 __struct.chan5_raw = buf.get_u16_le()?;
26325 __struct.chan6_raw = buf.get_u16_le()?;
26326 __struct.chan7_raw = buf.get_u16_le()?;
26327 __struct.chan8_raw = buf.get_u16_le()?;
26328 __struct.chan9_raw = buf.get_u16_le()?;
26329 __struct.chan10_raw = buf.get_u16_le()?;
26330 __struct.chan11_raw = buf.get_u16_le()?;
26331 __struct.chan12_raw = buf.get_u16_le()?;
26332 __struct.chan13_raw = buf.get_u16_le()?;
26333 __struct.chan14_raw = buf.get_u16_le()?;
26334 __struct.chan15_raw = buf.get_u16_le()?;
26335 __struct.chan16_raw = buf.get_u16_le()?;
26336 __struct.chan17_raw = buf.get_u16_le()?;
26337 __struct.chan18_raw = buf.get_u16_le()?;
26338 __struct.chancount = buf.get_u8()?;
26339 __struct.rssi = buf.get_u8()?;
26340 Ok(__struct)
26341 }
26342 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26343 let mut __tmp = BytesMut::new(bytes);
26344 #[allow(clippy::absurd_extreme_comparisons)]
26345 #[allow(unused_comparisons)]
26346 if __tmp.remaining() < Self::ENCODED_LEN {
26347 panic!(
26348 "buffer is too small (need {} bytes, but got {})",
26349 Self::ENCODED_LEN,
26350 __tmp.remaining(),
26351 )
26352 }
26353 __tmp.put_u32_le(self.time_boot_ms);
26354 __tmp.put_u16_le(self.chan1_raw);
26355 __tmp.put_u16_le(self.chan2_raw);
26356 __tmp.put_u16_le(self.chan3_raw);
26357 __tmp.put_u16_le(self.chan4_raw);
26358 __tmp.put_u16_le(self.chan5_raw);
26359 __tmp.put_u16_le(self.chan6_raw);
26360 __tmp.put_u16_le(self.chan7_raw);
26361 __tmp.put_u16_le(self.chan8_raw);
26362 __tmp.put_u16_le(self.chan9_raw);
26363 __tmp.put_u16_le(self.chan10_raw);
26364 __tmp.put_u16_le(self.chan11_raw);
26365 __tmp.put_u16_le(self.chan12_raw);
26366 __tmp.put_u16_le(self.chan13_raw);
26367 __tmp.put_u16_le(self.chan14_raw);
26368 __tmp.put_u16_le(self.chan15_raw);
26369 __tmp.put_u16_le(self.chan16_raw);
26370 __tmp.put_u16_le(self.chan17_raw);
26371 __tmp.put_u16_le(self.chan18_raw);
26372 __tmp.put_u8(self.chancount);
26373 __tmp.put_u8(self.rssi);
26374 if matches!(version, MavlinkVersion::V2) {
26375 let len = __tmp.len();
26376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26377 } else {
26378 __tmp.len()
26379 }
26380 }
26381}
26382#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26383#[doc = ""]
26384#[doc = "ID: 70"]
26385#[derive(Debug, Clone, PartialEq)]
26386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26388#[cfg_attr(feature = "ts", derive(TS))]
26389#[cfg_attr(feature = "ts", ts(export))]
26390pub struct RC_CHANNELS_OVERRIDE_DATA {
26391 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26392 pub chan1_raw: u16,
26393 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26394 pub chan2_raw: u16,
26395 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26396 pub chan3_raw: u16,
26397 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26398 pub chan4_raw: u16,
26399 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26400 pub chan5_raw: u16,
26401 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26402 pub chan6_raw: u16,
26403 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26404 pub chan7_raw: u16,
26405 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26406 pub chan8_raw: u16,
26407 #[doc = "System ID"]
26408 pub target_system: u8,
26409 #[doc = "Component ID"]
26410 pub target_component: u8,
26411 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26412 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26413 pub chan9_raw: u16,
26414 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26415 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26416 pub chan10_raw: u16,
26417 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26418 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26419 pub chan11_raw: u16,
26420 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26421 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26422 pub chan12_raw: u16,
26423 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26424 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26425 pub chan13_raw: u16,
26426 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26428 pub chan14_raw: u16,
26429 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26430 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26431 pub chan15_raw: u16,
26432 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26433 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26434 pub chan16_raw: u16,
26435 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26436 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26437 pub chan17_raw: u16,
26438 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26440 pub chan18_raw: u16,
26441}
26442impl RC_CHANNELS_OVERRIDE_DATA {
26443 pub const ENCODED_LEN: usize = 38usize;
26444 pub const DEFAULT: Self = Self {
26445 chan1_raw: 0_u16,
26446 chan2_raw: 0_u16,
26447 chan3_raw: 0_u16,
26448 chan4_raw: 0_u16,
26449 chan5_raw: 0_u16,
26450 chan6_raw: 0_u16,
26451 chan7_raw: 0_u16,
26452 chan8_raw: 0_u16,
26453 target_system: 0_u8,
26454 target_component: 0_u8,
26455 chan9_raw: 0_u16,
26456 chan10_raw: 0_u16,
26457 chan11_raw: 0_u16,
26458 chan12_raw: 0_u16,
26459 chan13_raw: 0_u16,
26460 chan14_raw: 0_u16,
26461 chan15_raw: 0_u16,
26462 chan16_raw: 0_u16,
26463 chan17_raw: 0_u16,
26464 chan18_raw: 0_u16,
26465 };
26466 #[cfg(feature = "arbitrary")]
26467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26468 use arbitrary::{Arbitrary, Unstructured};
26469 let mut buf = [0u8; 1024];
26470 rng.fill_bytes(&mut buf);
26471 let mut unstructured = Unstructured::new(&buf);
26472 Self::arbitrary(&mut unstructured).unwrap_or_default()
26473 }
26474}
26475impl Default for RC_CHANNELS_OVERRIDE_DATA {
26476 fn default() -> Self {
26477 Self::DEFAULT.clone()
26478 }
26479}
26480impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26481 type Message = MavMessage;
26482 const ID: u32 = 70u32;
26483 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26484 const EXTRA_CRC: u8 = 124u8;
26485 const ENCODED_LEN: usize = 38usize;
26486 fn deser(
26487 _version: MavlinkVersion,
26488 __input: &[u8],
26489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26490 let avail_len = __input.len();
26491 let mut payload_buf = [0; Self::ENCODED_LEN];
26492 let mut buf = if avail_len < Self::ENCODED_LEN {
26493 payload_buf[0..avail_len].copy_from_slice(__input);
26494 Bytes::new(&payload_buf)
26495 } else {
26496 Bytes::new(__input)
26497 };
26498 let mut __struct = Self::default();
26499 __struct.chan1_raw = buf.get_u16_le()?;
26500 __struct.chan2_raw = buf.get_u16_le()?;
26501 __struct.chan3_raw = buf.get_u16_le()?;
26502 __struct.chan4_raw = buf.get_u16_le()?;
26503 __struct.chan5_raw = buf.get_u16_le()?;
26504 __struct.chan6_raw = buf.get_u16_le()?;
26505 __struct.chan7_raw = buf.get_u16_le()?;
26506 __struct.chan8_raw = buf.get_u16_le()?;
26507 __struct.target_system = buf.get_u8()?;
26508 __struct.target_component = buf.get_u8()?;
26509 __struct.chan9_raw = buf.get_u16_le()?;
26510 __struct.chan10_raw = buf.get_u16_le()?;
26511 __struct.chan11_raw = buf.get_u16_le()?;
26512 __struct.chan12_raw = buf.get_u16_le()?;
26513 __struct.chan13_raw = buf.get_u16_le()?;
26514 __struct.chan14_raw = buf.get_u16_le()?;
26515 __struct.chan15_raw = buf.get_u16_le()?;
26516 __struct.chan16_raw = buf.get_u16_le()?;
26517 __struct.chan17_raw = buf.get_u16_le()?;
26518 __struct.chan18_raw = buf.get_u16_le()?;
26519 Ok(__struct)
26520 }
26521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26522 let mut __tmp = BytesMut::new(bytes);
26523 #[allow(clippy::absurd_extreme_comparisons)]
26524 #[allow(unused_comparisons)]
26525 if __tmp.remaining() < Self::ENCODED_LEN {
26526 panic!(
26527 "buffer is too small (need {} bytes, but got {})",
26528 Self::ENCODED_LEN,
26529 __tmp.remaining(),
26530 )
26531 }
26532 __tmp.put_u16_le(self.chan1_raw);
26533 __tmp.put_u16_le(self.chan2_raw);
26534 __tmp.put_u16_le(self.chan3_raw);
26535 __tmp.put_u16_le(self.chan4_raw);
26536 __tmp.put_u16_le(self.chan5_raw);
26537 __tmp.put_u16_le(self.chan6_raw);
26538 __tmp.put_u16_le(self.chan7_raw);
26539 __tmp.put_u16_le(self.chan8_raw);
26540 __tmp.put_u8(self.target_system);
26541 __tmp.put_u8(self.target_component);
26542 if matches!(version, MavlinkVersion::V2) {
26543 __tmp.put_u16_le(self.chan9_raw);
26544 __tmp.put_u16_le(self.chan10_raw);
26545 __tmp.put_u16_le(self.chan11_raw);
26546 __tmp.put_u16_le(self.chan12_raw);
26547 __tmp.put_u16_le(self.chan13_raw);
26548 __tmp.put_u16_le(self.chan14_raw);
26549 __tmp.put_u16_le(self.chan15_raw);
26550 __tmp.put_u16_le(self.chan16_raw);
26551 __tmp.put_u16_le(self.chan17_raw);
26552 __tmp.put_u16_le(self.chan18_raw);
26553 let len = __tmp.len();
26554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26555 } else {
26556 __tmp.len()
26557 }
26558 }
26559}
26560#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26561#[doc = ""]
26562#[doc = "ID: 35"]
26563#[derive(Debug, Clone, PartialEq)]
26564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26566#[cfg_attr(feature = "ts", derive(TS))]
26567#[cfg_attr(feature = "ts", ts(export))]
26568pub struct RC_CHANNELS_RAW_DATA {
26569 #[doc = "Timestamp (time since system boot)."]
26570 pub time_boot_ms: u32,
26571 #[doc = "RC channel 1 value."]
26572 pub chan1_raw: u16,
26573 #[doc = "RC channel 2 value."]
26574 pub chan2_raw: u16,
26575 #[doc = "RC channel 3 value."]
26576 pub chan3_raw: u16,
26577 #[doc = "RC channel 4 value."]
26578 pub chan4_raw: u16,
26579 #[doc = "RC channel 5 value."]
26580 pub chan5_raw: u16,
26581 #[doc = "RC channel 6 value."]
26582 pub chan6_raw: u16,
26583 #[doc = "RC channel 7 value."]
26584 pub chan7_raw: u16,
26585 #[doc = "RC channel 8 value."]
26586 pub chan8_raw: u16,
26587 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26588 pub port: u8,
26589 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26590 pub rssi: u8,
26591}
26592impl RC_CHANNELS_RAW_DATA {
26593 pub const ENCODED_LEN: usize = 22usize;
26594 pub const DEFAULT: Self = Self {
26595 time_boot_ms: 0_u32,
26596 chan1_raw: 0_u16,
26597 chan2_raw: 0_u16,
26598 chan3_raw: 0_u16,
26599 chan4_raw: 0_u16,
26600 chan5_raw: 0_u16,
26601 chan6_raw: 0_u16,
26602 chan7_raw: 0_u16,
26603 chan8_raw: 0_u16,
26604 port: 0_u8,
26605 rssi: 0_u8,
26606 };
26607 #[cfg(feature = "arbitrary")]
26608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26609 use arbitrary::{Arbitrary, Unstructured};
26610 let mut buf = [0u8; 1024];
26611 rng.fill_bytes(&mut buf);
26612 let mut unstructured = Unstructured::new(&buf);
26613 Self::arbitrary(&mut unstructured).unwrap_or_default()
26614 }
26615}
26616impl Default for RC_CHANNELS_RAW_DATA {
26617 fn default() -> Self {
26618 Self::DEFAULT.clone()
26619 }
26620}
26621impl MessageData for RC_CHANNELS_RAW_DATA {
26622 type Message = MavMessage;
26623 const ID: u32 = 35u32;
26624 const NAME: &'static str = "RC_CHANNELS_RAW";
26625 const EXTRA_CRC: u8 = 244u8;
26626 const ENCODED_LEN: usize = 22usize;
26627 fn deser(
26628 _version: MavlinkVersion,
26629 __input: &[u8],
26630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26631 let avail_len = __input.len();
26632 let mut payload_buf = [0; Self::ENCODED_LEN];
26633 let mut buf = if avail_len < Self::ENCODED_LEN {
26634 payload_buf[0..avail_len].copy_from_slice(__input);
26635 Bytes::new(&payload_buf)
26636 } else {
26637 Bytes::new(__input)
26638 };
26639 let mut __struct = Self::default();
26640 __struct.time_boot_ms = buf.get_u32_le()?;
26641 __struct.chan1_raw = buf.get_u16_le()?;
26642 __struct.chan2_raw = buf.get_u16_le()?;
26643 __struct.chan3_raw = buf.get_u16_le()?;
26644 __struct.chan4_raw = buf.get_u16_le()?;
26645 __struct.chan5_raw = buf.get_u16_le()?;
26646 __struct.chan6_raw = buf.get_u16_le()?;
26647 __struct.chan7_raw = buf.get_u16_le()?;
26648 __struct.chan8_raw = buf.get_u16_le()?;
26649 __struct.port = buf.get_u8()?;
26650 __struct.rssi = buf.get_u8()?;
26651 Ok(__struct)
26652 }
26653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26654 let mut __tmp = BytesMut::new(bytes);
26655 #[allow(clippy::absurd_extreme_comparisons)]
26656 #[allow(unused_comparisons)]
26657 if __tmp.remaining() < Self::ENCODED_LEN {
26658 panic!(
26659 "buffer is too small (need {} bytes, but got {})",
26660 Self::ENCODED_LEN,
26661 __tmp.remaining(),
26662 )
26663 }
26664 __tmp.put_u32_le(self.time_boot_ms);
26665 __tmp.put_u16_le(self.chan1_raw);
26666 __tmp.put_u16_le(self.chan2_raw);
26667 __tmp.put_u16_le(self.chan3_raw);
26668 __tmp.put_u16_le(self.chan4_raw);
26669 __tmp.put_u16_le(self.chan5_raw);
26670 __tmp.put_u16_le(self.chan6_raw);
26671 __tmp.put_u16_le(self.chan7_raw);
26672 __tmp.put_u16_le(self.chan8_raw);
26673 __tmp.put_u8(self.port);
26674 __tmp.put_u8(self.rssi);
26675 if matches!(version, MavlinkVersion::V2) {
26676 let len = __tmp.len();
26677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26678 } else {
26679 __tmp.len()
26680 }
26681 }
26682}
26683#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26684#[doc = ""]
26685#[doc = "ID: 34"]
26686#[derive(Debug, Clone, PartialEq)]
26687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26689#[cfg_attr(feature = "ts", derive(TS))]
26690#[cfg_attr(feature = "ts", ts(export))]
26691pub struct RC_CHANNELS_SCALED_DATA {
26692 #[doc = "Timestamp (time since system boot)."]
26693 pub time_boot_ms: u32,
26694 #[doc = "RC channel 1 value scaled."]
26695 pub chan1_scaled: i16,
26696 #[doc = "RC channel 2 value scaled."]
26697 pub chan2_scaled: i16,
26698 #[doc = "RC channel 3 value scaled."]
26699 pub chan3_scaled: i16,
26700 #[doc = "RC channel 4 value scaled."]
26701 pub chan4_scaled: i16,
26702 #[doc = "RC channel 5 value scaled."]
26703 pub chan5_scaled: i16,
26704 #[doc = "RC channel 6 value scaled."]
26705 pub chan6_scaled: i16,
26706 #[doc = "RC channel 7 value scaled."]
26707 pub chan7_scaled: i16,
26708 #[doc = "RC channel 8 value scaled."]
26709 pub chan8_scaled: i16,
26710 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26711 pub port: u8,
26712 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26713 pub rssi: u8,
26714}
26715impl RC_CHANNELS_SCALED_DATA {
26716 pub const ENCODED_LEN: usize = 22usize;
26717 pub const DEFAULT: Self = Self {
26718 time_boot_ms: 0_u32,
26719 chan1_scaled: 0_i16,
26720 chan2_scaled: 0_i16,
26721 chan3_scaled: 0_i16,
26722 chan4_scaled: 0_i16,
26723 chan5_scaled: 0_i16,
26724 chan6_scaled: 0_i16,
26725 chan7_scaled: 0_i16,
26726 chan8_scaled: 0_i16,
26727 port: 0_u8,
26728 rssi: 0_u8,
26729 };
26730 #[cfg(feature = "arbitrary")]
26731 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26732 use arbitrary::{Arbitrary, Unstructured};
26733 let mut buf = [0u8; 1024];
26734 rng.fill_bytes(&mut buf);
26735 let mut unstructured = Unstructured::new(&buf);
26736 Self::arbitrary(&mut unstructured).unwrap_or_default()
26737 }
26738}
26739impl Default for RC_CHANNELS_SCALED_DATA {
26740 fn default() -> Self {
26741 Self::DEFAULT.clone()
26742 }
26743}
26744impl MessageData for RC_CHANNELS_SCALED_DATA {
26745 type Message = MavMessage;
26746 const ID: u32 = 34u32;
26747 const NAME: &'static str = "RC_CHANNELS_SCALED";
26748 const EXTRA_CRC: u8 = 237u8;
26749 const ENCODED_LEN: usize = 22usize;
26750 fn deser(
26751 _version: MavlinkVersion,
26752 __input: &[u8],
26753 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26754 let avail_len = __input.len();
26755 let mut payload_buf = [0; Self::ENCODED_LEN];
26756 let mut buf = if avail_len < Self::ENCODED_LEN {
26757 payload_buf[0..avail_len].copy_from_slice(__input);
26758 Bytes::new(&payload_buf)
26759 } else {
26760 Bytes::new(__input)
26761 };
26762 let mut __struct = Self::default();
26763 __struct.time_boot_ms = buf.get_u32_le()?;
26764 __struct.chan1_scaled = buf.get_i16_le()?;
26765 __struct.chan2_scaled = buf.get_i16_le()?;
26766 __struct.chan3_scaled = buf.get_i16_le()?;
26767 __struct.chan4_scaled = buf.get_i16_le()?;
26768 __struct.chan5_scaled = buf.get_i16_le()?;
26769 __struct.chan6_scaled = buf.get_i16_le()?;
26770 __struct.chan7_scaled = buf.get_i16_le()?;
26771 __struct.chan8_scaled = buf.get_i16_le()?;
26772 __struct.port = buf.get_u8()?;
26773 __struct.rssi = buf.get_u8()?;
26774 Ok(__struct)
26775 }
26776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26777 let mut __tmp = BytesMut::new(bytes);
26778 #[allow(clippy::absurd_extreme_comparisons)]
26779 #[allow(unused_comparisons)]
26780 if __tmp.remaining() < Self::ENCODED_LEN {
26781 panic!(
26782 "buffer is too small (need {} bytes, but got {})",
26783 Self::ENCODED_LEN,
26784 __tmp.remaining(),
26785 )
26786 }
26787 __tmp.put_u32_le(self.time_boot_ms);
26788 __tmp.put_i16_le(self.chan1_scaled);
26789 __tmp.put_i16_le(self.chan2_scaled);
26790 __tmp.put_i16_le(self.chan3_scaled);
26791 __tmp.put_i16_le(self.chan4_scaled);
26792 __tmp.put_i16_le(self.chan5_scaled);
26793 __tmp.put_i16_le(self.chan6_scaled);
26794 __tmp.put_i16_le(self.chan7_scaled);
26795 __tmp.put_i16_le(self.chan8_scaled);
26796 __tmp.put_u8(self.port);
26797 __tmp.put_u8(self.rssi);
26798 if matches!(version, MavlinkVersion::V2) {
26799 let len = __tmp.len();
26800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26801 } else {
26802 __tmp.len()
26803 }
26804 }
26805}
26806#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26807#[doc = "Request a data stream."]
26808#[doc = ""]
26809#[doc = "ID: 66"]
26810#[derive(Debug, Clone, PartialEq)]
26811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26813#[cfg_attr(feature = "ts", derive(TS))]
26814#[cfg_attr(feature = "ts", ts(export))]
26815pub struct REQUEST_DATA_STREAM_DATA {
26816 #[doc = "The requested message rate"]
26817 pub req_message_rate: u16,
26818 #[doc = "The target requested to send the message stream."]
26819 pub target_system: u8,
26820 #[doc = "The target requested to send the message stream."]
26821 pub target_component: u8,
26822 #[doc = "The ID of the requested data stream"]
26823 pub req_stream_id: u8,
26824 #[doc = "1 to start sending, 0 to stop sending."]
26825 pub start_stop: u8,
26826}
26827impl REQUEST_DATA_STREAM_DATA {
26828 pub const ENCODED_LEN: usize = 6usize;
26829 pub const DEFAULT: Self = Self {
26830 req_message_rate: 0_u16,
26831 target_system: 0_u8,
26832 target_component: 0_u8,
26833 req_stream_id: 0_u8,
26834 start_stop: 0_u8,
26835 };
26836 #[cfg(feature = "arbitrary")]
26837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26838 use arbitrary::{Arbitrary, Unstructured};
26839 let mut buf = [0u8; 1024];
26840 rng.fill_bytes(&mut buf);
26841 let mut unstructured = Unstructured::new(&buf);
26842 Self::arbitrary(&mut unstructured).unwrap_or_default()
26843 }
26844}
26845impl Default for REQUEST_DATA_STREAM_DATA {
26846 fn default() -> Self {
26847 Self::DEFAULT.clone()
26848 }
26849}
26850impl MessageData for REQUEST_DATA_STREAM_DATA {
26851 type Message = MavMessage;
26852 const ID: u32 = 66u32;
26853 const NAME: &'static str = "REQUEST_DATA_STREAM";
26854 const EXTRA_CRC: u8 = 148u8;
26855 const ENCODED_LEN: usize = 6usize;
26856 fn deser(
26857 _version: MavlinkVersion,
26858 __input: &[u8],
26859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26860 let avail_len = __input.len();
26861 let mut payload_buf = [0; Self::ENCODED_LEN];
26862 let mut buf = if avail_len < Self::ENCODED_LEN {
26863 payload_buf[0..avail_len].copy_from_slice(__input);
26864 Bytes::new(&payload_buf)
26865 } else {
26866 Bytes::new(__input)
26867 };
26868 let mut __struct = Self::default();
26869 __struct.req_message_rate = buf.get_u16_le()?;
26870 __struct.target_system = buf.get_u8()?;
26871 __struct.target_component = buf.get_u8()?;
26872 __struct.req_stream_id = buf.get_u8()?;
26873 __struct.start_stop = buf.get_u8()?;
26874 Ok(__struct)
26875 }
26876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26877 let mut __tmp = BytesMut::new(bytes);
26878 #[allow(clippy::absurd_extreme_comparisons)]
26879 #[allow(unused_comparisons)]
26880 if __tmp.remaining() < Self::ENCODED_LEN {
26881 panic!(
26882 "buffer is too small (need {} bytes, but got {})",
26883 Self::ENCODED_LEN,
26884 __tmp.remaining(),
26885 )
26886 }
26887 __tmp.put_u16_le(self.req_message_rate);
26888 __tmp.put_u8(self.target_system);
26889 __tmp.put_u8(self.target_component);
26890 __tmp.put_u8(self.req_stream_id);
26891 __tmp.put_u8(self.start_stop);
26892 if matches!(version, MavlinkVersion::V2) {
26893 let len = __tmp.len();
26894 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26895 } else {
26896 __tmp.len()
26897 }
26898 }
26899}
26900#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26901#[doc = ""]
26902#[doc = "ID: 412"]
26903#[derive(Debug, Clone, PartialEq)]
26904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26906#[cfg_attr(feature = "ts", derive(TS))]
26907#[cfg_attr(feature = "ts", ts(export))]
26908pub struct REQUEST_EVENT_DATA {
26909 #[doc = "First sequence number of the requested event."]
26910 pub first_sequence: u16,
26911 #[doc = "Last sequence number of the requested event."]
26912 pub last_sequence: u16,
26913 #[doc = "System ID"]
26914 pub target_system: u8,
26915 #[doc = "Component ID"]
26916 pub target_component: u8,
26917}
26918impl REQUEST_EVENT_DATA {
26919 pub const ENCODED_LEN: usize = 6usize;
26920 pub const DEFAULT: Self = Self {
26921 first_sequence: 0_u16,
26922 last_sequence: 0_u16,
26923 target_system: 0_u8,
26924 target_component: 0_u8,
26925 };
26926 #[cfg(feature = "arbitrary")]
26927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26928 use arbitrary::{Arbitrary, Unstructured};
26929 let mut buf = [0u8; 1024];
26930 rng.fill_bytes(&mut buf);
26931 let mut unstructured = Unstructured::new(&buf);
26932 Self::arbitrary(&mut unstructured).unwrap_or_default()
26933 }
26934}
26935impl Default for REQUEST_EVENT_DATA {
26936 fn default() -> Self {
26937 Self::DEFAULT.clone()
26938 }
26939}
26940impl MessageData for REQUEST_EVENT_DATA {
26941 type Message = MavMessage;
26942 const ID: u32 = 412u32;
26943 const NAME: &'static str = "REQUEST_EVENT";
26944 const EXTRA_CRC: u8 = 33u8;
26945 const ENCODED_LEN: usize = 6usize;
26946 fn deser(
26947 _version: MavlinkVersion,
26948 __input: &[u8],
26949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26950 let avail_len = __input.len();
26951 let mut payload_buf = [0; Self::ENCODED_LEN];
26952 let mut buf = if avail_len < Self::ENCODED_LEN {
26953 payload_buf[0..avail_len].copy_from_slice(__input);
26954 Bytes::new(&payload_buf)
26955 } else {
26956 Bytes::new(__input)
26957 };
26958 let mut __struct = Self::default();
26959 __struct.first_sequence = buf.get_u16_le()?;
26960 __struct.last_sequence = buf.get_u16_le()?;
26961 __struct.target_system = buf.get_u8()?;
26962 __struct.target_component = buf.get_u8()?;
26963 Ok(__struct)
26964 }
26965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26966 let mut __tmp = BytesMut::new(bytes);
26967 #[allow(clippy::absurd_extreme_comparisons)]
26968 #[allow(unused_comparisons)]
26969 if __tmp.remaining() < Self::ENCODED_LEN {
26970 panic!(
26971 "buffer is too small (need {} bytes, but got {})",
26972 Self::ENCODED_LEN,
26973 __tmp.remaining(),
26974 )
26975 }
26976 __tmp.put_u16_le(self.first_sequence);
26977 __tmp.put_u16_le(self.last_sequence);
26978 __tmp.put_u8(self.target_system);
26979 __tmp.put_u8(self.target_component);
26980 if matches!(version, MavlinkVersion::V2) {
26981 let len = __tmp.len();
26982 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26983 } else {
26984 __tmp.len()
26985 }
26986 }
26987}
26988#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26989#[doc = ""]
26990#[doc = "ID: 142"]
26991#[derive(Debug, Clone, PartialEq)]
26992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26994#[cfg_attr(feature = "ts", derive(TS))]
26995#[cfg_attr(feature = "ts", ts(export))]
26996pub struct RESOURCE_REQUEST_DATA {
26997 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26998 pub request_id: u8,
26999 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
27000 pub uri_type: u8,
27001 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
27002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27003 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27004 pub uri: [u8; 120],
27005 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
27006 pub transfer_type: u8,
27007 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
27008 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27009 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27010 pub storage: [u8; 120],
27011}
27012impl RESOURCE_REQUEST_DATA {
27013 pub const ENCODED_LEN: usize = 243usize;
27014 pub const DEFAULT: Self = Self {
27015 request_id: 0_u8,
27016 uri_type: 0_u8,
27017 uri: [0_u8; 120usize],
27018 transfer_type: 0_u8,
27019 storage: [0_u8; 120usize],
27020 };
27021 #[cfg(feature = "arbitrary")]
27022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27023 use arbitrary::{Arbitrary, Unstructured};
27024 let mut buf = [0u8; 1024];
27025 rng.fill_bytes(&mut buf);
27026 let mut unstructured = Unstructured::new(&buf);
27027 Self::arbitrary(&mut unstructured).unwrap_or_default()
27028 }
27029}
27030impl Default for RESOURCE_REQUEST_DATA {
27031 fn default() -> Self {
27032 Self::DEFAULT.clone()
27033 }
27034}
27035impl MessageData for RESOURCE_REQUEST_DATA {
27036 type Message = MavMessage;
27037 const ID: u32 = 142u32;
27038 const NAME: &'static str = "RESOURCE_REQUEST";
27039 const EXTRA_CRC: u8 = 72u8;
27040 const ENCODED_LEN: usize = 243usize;
27041 fn deser(
27042 _version: MavlinkVersion,
27043 __input: &[u8],
27044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27045 let avail_len = __input.len();
27046 let mut payload_buf = [0; Self::ENCODED_LEN];
27047 let mut buf = if avail_len < Self::ENCODED_LEN {
27048 payload_buf[0..avail_len].copy_from_slice(__input);
27049 Bytes::new(&payload_buf)
27050 } else {
27051 Bytes::new(__input)
27052 };
27053 let mut __struct = Self::default();
27054 __struct.request_id = buf.get_u8()?;
27055 __struct.uri_type = buf.get_u8()?;
27056 for v in &mut __struct.uri {
27057 let val = buf.get_u8()?;
27058 *v = val;
27059 }
27060 __struct.transfer_type = buf.get_u8()?;
27061 for v in &mut __struct.storage {
27062 let val = buf.get_u8()?;
27063 *v = val;
27064 }
27065 Ok(__struct)
27066 }
27067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27068 let mut __tmp = BytesMut::new(bytes);
27069 #[allow(clippy::absurd_extreme_comparisons)]
27070 #[allow(unused_comparisons)]
27071 if __tmp.remaining() < Self::ENCODED_LEN {
27072 panic!(
27073 "buffer is too small (need {} bytes, but got {})",
27074 Self::ENCODED_LEN,
27075 __tmp.remaining(),
27076 )
27077 }
27078 __tmp.put_u8(self.request_id);
27079 __tmp.put_u8(self.uri_type);
27080 for val in &self.uri {
27081 __tmp.put_u8(*val);
27082 }
27083 __tmp.put_u8(self.transfer_type);
27084 for val in &self.storage {
27085 __tmp.put_u8(*val);
27086 }
27087 if matches!(version, MavlinkVersion::V2) {
27088 let len = __tmp.len();
27089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27090 } else {
27091 __tmp.len()
27092 }
27093 }
27094}
27095#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
27096#[doc = ""]
27097#[doc = "ID: 413"]
27098#[derive(Debug, Clone, PartialEq)]
27099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27101#[cfg_attr(feature = "ts", derive(TS))]
27102#[cfg_attr(feature = "ts", ts(export))]
27103pub struct RESPONSE_EVENT_ERROR_DATA {
27104 #[doc = "Sequence number."]
27105 pub sequence: u16,
27106 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
27107 pub sequence_oldest_available: u16,
27108 #[doc = "System ID"]
27109 pub target_system: u8,
27110 #[doc = "Component ID"]
27111 pub target_component: u8,
27112 #[doc = "Error reason."]
27113 pub reason: MavEventErrorReason,
27114}
27115impl RESPONSE_EVENT_ERROR_DATA {
27116 pub const ENCODED_LEN: usize = 7usize;
27117 pub const DEFAULT: Self = Self {
27118 sequence: 0_u16,
27119 sequence_oldest_available: 0_u16,
27120 target_system: 0_u8,
27121 target_component: 0_u8,
27122 reason: MavEventErrorReason::DEFAULT,
27123 };
27124 #[cfg(feature = "arbitrary")]
27125 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27126 use arbitrary::{Arbitrary, Unstructured};
27127 let mut buf = [0u8; 1024];
27128 rng.fill_bytes(&mut buf);
27129 let mut unstructured = Unstructured::new(&buf);
27130 Self::arbitrary(&mut unstructured).unwrap_or_default()
27131 }
27132}
27133impl Default for RESPONSE_EVENT_ERROR_DATA {
27134 fn default() -> Self {
27135 Self::DEFAULT.clone()
27136 }
27137}
27138impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27139 type Message = MavMessage;
27140 const ID: u32 = 413u32;
27141 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27142 const EXTRA_CRC: u8 = 77u8;
27143 const ENCODED_LEN: usize = 7usize;
27144 fn deser(
27145 _version: MavlinkVersion,
27146 __input: &[u8],
27147 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27148 let avail_len = __input.len();
27149 let mut payload_buf = [0; Self::ENCODED_LEN];
27150 let mut buf = if avail_len < Self::ENCODED_LEN {
27151 payload_buf[0..avail_len].copy_from_slice(__input);
27152 Bytes::new(&payload_buf)
27153 } else {
27154 Bytes::new(__input)
27155 };
27156 let mut __struct = Self::default();
27157 __struct.sequence = buf.get_u16_le()?;
27158 __struct.sequence_oldest_available = buf.get_u16_le()?;
27159 __struct.target_system = buf.get_u8()?;
27160 __struct.target_component = buf.get_u8()?;
27161 let tmp = buf.get_u8()?;
27162 __struct.reason =
27163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27164 enum_type: "MavEventErrorReason",
27165 value: tmp as u64,
27166 })?;
27167 Ok(__struct)
27168 }
27169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27170 let mut __tmp = BytesMut::new(bytes);
27171 #[allow(clippy::absurd_extreme_comparisons)]
27172 #[allow(unused_comparisons)]
27173 if __tmp.remaining() < Self::ENCODED_LEN {
27174 panic!(
27175 "buffer is too small (need {} bytes, but got {})",
27176 Self::ENCODED_LEN,
27177 __tmp.remaining(),
27178 )
27179 }
27180 __tmp.put_u16_le(self.sequence);
27181 __tmp.put_u16_le(self.sequence_oldest_available);
27182 __tmp.put_u8(self.target_system);
27183 __tmp.put_u8(self.target_component);
27184 __tmp.put_u8(self.reason as u8);
27185 if matches!(version, MavlinkVersion::V2) {
27186 let len = __tmp.len();
27187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27188 } else {
27189 __tmp.len()
27190 }
27191 }
27192}
27193#[doc = "Read out the safety zone the MAV currently assumes."]
27194#[doc = ""]
27195#[doc = "ID: 55"]
27196#[derive(Debug, Clone, PartialEq)]
27197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27199#[cfg_attr(feature = "ts", derive(TS))]
27200#[cfg_attr(feature = "ts", ts(export))]
27201pub struct SAFETY_ALLOWED_AREA_DATA {
27202 #[doc = "x position 1 / Latitude 1"]
27203 pub p1x: f32,
27204 #[doc = "y position 1 / Longitude 1"]
27205 pub p1y: f32,
27206 #[doc = "z position 1 / Altitude 1"]
27207 pub p1z: f32,
27208 #[doc = "x position 2 / Latitude 2"]
27209 pub p2x: f32,
27210 #[doc = "y position 2 / Longitude 2"]
27211 pub p2y: f32,
27212 #[doc = "z position 2 / Altitude 2"]
27213 pub p2z: f32,
27214 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27215 pub frame: MavFrame,
27216}
27217impl SAFETY_ALLOWED_AREA_DATA {
27218 pub const ENCODED_LEN: usize = 25usize;
27219 pub const DEFAULT: Self = Self {
27220 p1x: 0.0_f32,
27221 p1y: 0.0_f32,
27222 p1z: 0.0_f32,
27223 p2x: 0.0_f32,
27224 p2y: 0.0_f32,
27225 p2z: 0.0_f32,
27226 frame: MavFrame::DEFAULT,
27227 };
27228 #[cfg(feature = "arbitrary")]
27229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27230 use arbitrary::{Arbitrary, Unstructured};
27231 let mut buf = [0u8; 1024];
27232 rng.fill_bytes(&mut buf);
27233 let mut unstructured = Unstructured::new(&buf);
27234 Self::arbitrary(&mut unstructured).unwrap_or_default()
27235 }
27236}
27237impl Default for SAFETY_ALLOWED_AREA_DATA {
27238 fn default() -> Self {
27239 Self::DEFAULT.clone()
27240 }
27241}
27242impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27243 type Message = MavMessage;
27244 const ID: u32 = 55u32;
27245 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27246 const EXTRA_CRC: u8 = 3u8;
27247 const ENCODED_LEN: usize = 25usize;
27248 fn deser(
27249 _version: MavlinkVersion,
27250 __input: &[u8],
27251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27252 let avail_len = __input.len();
27253 let mut payload_buf = [0; Self::ENCODED_LEN];
27254 let mut buf = if avail_len < Self::ENCODED_LEN {
27255 payload_buf[0..avail_len].copy_from_slice(__input);
27256 Bytes::new(&payload_buf)
27257 } else {
27258 Bytes::new(__input)
27259 };
27260 let mut __struct = Self::default();
27261 __struct.p1x = buf.get_f32_le()?;
27262 __struct.p1y = buf.get_f32_le()?;
27263 __struct.p1z = buf.get_f32_le()?;
27264 __struct.p2x = buf.get_f32_le()?;
27265 __struct.p2y = buf.get_f32_le()?;
27266 __struct.p2z = buf.get_f32_le()?;
27267 let tmp = buf.get_u8()?;
27268 __struct.frame =
27269 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27270 enum_type: "MavFrame",
27271 value: tmp as u64,
27272 })?;
27273 Ok(__struct)
27274 }
27275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27276 let mut __tmp = BytesMut::new(bytes);
27277 #[allow(clippy::absurd_extreme_comparisons)]
27278 #[allow(unused_comparisons)]
27279 if __tmp.remaining() < Self::ENCODED_LEN {
27280 panic!(
27281 "buffer is too small (need {} bytes, but got {})",
27282 Self::ENCODED_LEN,
27283 __tmp.remaining(),
27284 )
27285 }
27286 __tmp.put_f32_le(self.p1x);
27287 __tmp.put_f32_le(self.p1y);
27288 __tmp.put_f32_le(self.p1z);
27289 __tmp.put_f32_le(self.p2x);
27290 __tmp.put_f32_le(self.p2y);
27291 __tmp.put_f32_le(self.p2z);
27292 __tmp.put_u8(self.frame as u8);
27293 if matches!(version, MavlinkVersion::V2) {
27294 let len = __tmp.len();
27295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27296 } else {
27297 __tmp.len()
27298 }
27299 }
27300}
27301#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27302#[doc = ""]
27303#[doc = "ID: 54"]
27304#[derive(Debug, Clone, PartialEq)]
27305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27307#[cfg_attr(feature = "ts", derive(TS))]
27308#[cfg_attr(feature = "ts", ts(export))]
27309pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27310 #[doc = "x position 1 / Latitude 1"]
27311 pub p1x: f32,
27312 #[doc = "y position 1 / Longitude 1"]
27313 pub p1y: f32,
27314 #[doc = "z position 1 / Altitude 1"]
27315 pub p1z: f32,
27316 #[doc = "x position 2 / Latitude 2"]
27317 pub p2x: f32,
27318 #[doc = "y position 2 / Longitude 2"]
27319 pub p2y: f32,
27320 #[doc = "z position 2 / Altitude 2"]
27321 pub p2z: f32,
27322 #[doc = "System ID"]
27323 pub target_system: u8,
27324 #[doc = "Component ID"]
27325 pub target_component: u8,
27326 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27327 pub frame: MavFrame,
27328}
27329impl SAFETY_SET_ALLOWED_AREA_DATA {
27330 pub const ENCODED_LEN: usize = 27usize;
27331 pub const DEFAULT: Self = Self {
27332 p1x: 0.0_f32,
27333 p1y: 0.0_f32,
27334 p1z: 0.0_f32,
27335 p2x: 0.0_f32,
27336 p2y: 0.0_f32,
27337 p2z: 0.0_f32,
27338 target_system: 0_u8,
27339 target_component: 0_u8,
27340 frame: MavFrame::DEFAULT,
27341 };
27342 #[cfg(feature = "arbitrary")]
27343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27344 use arbitrary::{Arbitrary, Unstructured};
27345 let mut buf = [0u8; 1024];
27346 rng.fill_bytes(&mut buf);
27347 let mut unstructured = Unstructured::new(&buf);
27348 Self::arbitrary(&mut unstructured).unwrap_or_default()
27349 }
27350}
27351impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27352 fn default() -> Self {
27353 Self::DEFAULT.clone()
27354 }
27355}
27356impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27357 type Message = MavMessage;
27358 const ID: u32 = 54u32;
27359 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27360 const EXTRA_CRC: u8 = 15u8;
27361 const ENCODED_LEN: usize = 27usize;
27362 fn deser(
27363 _version: MavlinkVersion,
27364 __input: &[u8],
27365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27366 let avail_len = __input.len();
27367 let mut payload_buf = [0; Self::ENCODED_LEN];
27368 let mut buf = if avail_len < Self::ENCODED_LEN {
27369 payload_buf[0..avail_len].copy_from_slice(__input);
27370 Bytes::new(&payload_buf)
27371 } else {
27372 Bytes::new(__input)
27373 };
27374 let mut __struct = Self::default();
27375 __struct.p1x = buf.get_f32_le()?;
27376 __struct.p1y = buf.get_f32_le()?;
27377 __struct.p1z = buf.get_f32_le()?;
27378 __struct.p2x = buf.get_f32_le()?;
27379 __struct.p2y = buf.get_f32_le()?;
27380 __struct.p2z = buf.get_f32_le()?;
27381 __struct.target_system = buf.get_u8()?;
27382 __struct.target_component = buf.get_u8()?;
27383 let tmp = buf.get_u8()?;
27384 __struct.frame =
27385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27386 enum_type: "MavFrame",
27387 value: tmp as u64,
27388 })?;
27389 Ok(__struct)
27390 }
27391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27392 let mut __tmp = BytesMut::new(bytes);
27393 #[allow(clippy::absurd_extreme_comparisons)]
27394 #[allow(unused_comparisons)]
27395 if __tmp.remaining() < Self::ENCODED_LEN {
27396 panic!(
27397 "buffer is too small (need {} bytes, but got {})",
27398 Self::ENCODED_LEN,
27399 __tmp.remaining(),
27400 )
27401 }
27402 __tmp.put_f32_le(self.p1x);
27403 __tmp.put_f32_le(self.p1y);
27404 __tmp.put_f32_le(self.p1z);
27405 __tmp.put_f32_le(self.p2x);
27406 __tmp.put_f32_le(self.p2y);
27407 __tmp.put_f32_le(self.p2z);
27408 __tmp.put_u8(self.target_system);
27409 __tmp.put_u8(self.target_component);
27410 __tmp.put_u8(self.frame as u8);
27411 if matches!(version, MavlinkVersion::V2) {
27412 let len = __tmp.len();
27413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27414 } else {
27415 __tmp.len()
27416 }
27417 }
27418}
27419#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27420#[doc = ""]
27421#[doc = "ID: 26"]
27422#[derive(Debug, Clone, PartialEq)]
27423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27425#[cfg_attr(feature = "ts", derive(TS))]
27426#[cfg_attr(feature = "ts", ts(export))]
27427pub struct SCALED_IMU_DATA {
27428 #[doc = "Timestamp (time since system boot)."]
27429 pub time_boot_ms: u32,
27430 #[doc = "X acceleration"]
27431 pub xacc: i16,
27432 #[doc = "Y acceleration"]
27433 pub yacc: i16,
27434 #[doc = "Z acceleration"]
27435 pub zacc: i16,
27436 #[doc = "Angular speed around X axis"]
27437 pub xgyro: i16,
27438 #[doc = "Angular speed around Y axis"]
27439 pub ygyro: i16,
27440 #[doc = "Angular speed around Z axis"]
27441 pub zgyro: i16,
27442 #[doc = "X Magnetic field"]
27443 pub xmag: i16,
27444 #[doc = "Y Magnetic field"]
27445 pub ymag: i16,
27446 #[doc = "Z Magnetic field"]
27447 pub zmag: i16,
27448 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27449 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27450 pub temperature: i16,
27451}
27452impl SCALED_IMU_DATA {
27453 pub const ENCODED_LEN: usize = 24usize;
27454 pub const DEFAULT: Self = Self {
27455 time_boot_ms: 0_u32,
27456 xacc: 0_i16,
27457 yacc: 0_i16,
27458 zacc: 0_i16,
27459 xgyro: 0_i16,
27460 ygyro: 0_i16,
27461 zgyro: 0_i16,
27462 xmag: 0_i16,
27463 ymag: 0_i16,
27464 zmag: 0_i16,
27465 temperature: 0_i16,
27466 };
27467 #[cfg(feature = "arbitrary")]
27468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27469 use arbitrary::{Arbitrary, Unstructured};
27470 let mut buf = [0u8; 1024];
27471 rng.fill_bytes(&mut buf);
27472 let mut unstructured = Unstructured::new(&buf);
27473 Self::arbitrary(&mut unstructured).unwrap_or_default()
27474 }
27475}
27476impl Default for SCALED_IMU_DATA {
27477 fn default() -> Self {
27478 Self::DEFAULT.clone()
27479 }
27480}
27481impl MessageData for SCALED_IMU_DATA {
27482 type Message = MavMessage;
27483 const ID: u32 = 26u32;
27484 const NAME: &'static str = "SCALED_IMU";
27485 const EXTRA_CRC: u8 = 170u8;
27486 const ENCODED_LEN: usize = 24usize;
27487 fn deser(
27488 _version: MavlinkVersion,
27489 __input: &[u8],
27490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27491 let avail_len = __input.len();
27492 let mut payload_buf = [0; Self::ENCODED_LEN];
27493 let mut buf = if avail_len < Self::ENCODED_LEN {
27494 payload_buf[0..avail_len].copy_from_slice(__input);
27495 Bytes::new(&payload_buf)
27496 } else {
27497 Bytes::new(__input)
27498 };
27499 let mut __struct = Self::default();
27500 __struct.time_boot_ms = buf.get_u32_le()?;
27501 __struct.xacc = buf.get_i16_le()?;
27502 __struct.yacc = buf.get_i16_le()?;
27503 __struct.zacc = buf.get_i16_le()?;
27504 __struct.xgyro = buf.get_i16_le()?;
27505 __struct.ygyro = buf.get_i16_le()?;
27506 __struct.zgyro = buf.get_i16_le()?;
27507 __struct.xmag = buf.get_i16_le()?;
27508 __struct.ymag = buf.get_i16_le()?;
27509 __struct.zmag = buf.get_i16_le()?;
27510 __struct.temperature = buf.get_i16_le()?;
27511 Ok(__struct)
27512 }
27513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27514 let mut __tmp = BytesMut::new(bytes);
27515 #[allow(clippy::absurd_extreme_comparisons)]
27516 #[allow(unused_comparisons)]
27517 if __tmp.remaining() < Self::ENCODED_LEN {
27518 panic!(
27519 "buffer is too small (need {} bytes, but got {})",
27520 Self::ENCODED_LEN,
27521 __tmp.remaining(),
27522 )
27523 }
27524 __tmp.put_u32_le(self.time_boot_ms);
27525 __tmp.put_i16_le(self.xacc);
27526 __tmp.put_i16_le(self.yacc);
27527 __tmp.put_i16_le(self.zacc);
27528 __tmp.put_i16_le(self.xgyro);
27529 __tmp.put_i16_le(self.ygyro);
27530 __tmp.put_i16_le(self.zgyro);
27531 __tmp.put_i16_le(self.xmag);
27532 __tmp.put_i16_le(self.ymag);
27533 __tmp.put_i16_le(self.zmag);
27534 if matches!(version, MavlinkVersion::V2) {
27535 __tmp.put_i16_le(self.temperature);
27536 let len = __tmp.len();
27537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27538 } else {
27539 __tmp.len()
27540 }
27541 }
27542}
27543#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27544#[doc = ""]
27545#[doc = "ID: 116"]
27546#[derive(Debug, Clone, PartialEq)]
27547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27549#[cfg_attr(feature = "ts", derive(TS))]
27550#[cfg_attr(feature = "ts", ts(export))]
27551pub struct SCALED_IMU2_DATA {
27552 #[doc = "Timestamp (time since system boot)."]
27553 pub time_boot_ms: u32,
27554 #[doc = "X acceleration"]
27555 pub xacc: i16,
27556 #[doc = "Y acceleration"]
27557 pub yacc: i16,
27558 #[doc = "Z acceleration"]
27559 pub zacc: i16,
27560 #[doc = "Angular speed around X axis"]
27561 pub xgyro: i16,
27562 #[doc = "Angular speed around Y axis"]
27563 pub ygyro: i16,
27564 #[doc = "Angular speed around Z axis"]
27565 pub zgyro: i16,
27566 #[doc = "X Magnetic field"]
27567 pub xmag: i16,
27568 #[doc = "Y Magnetic field"]
27569 pub ymag: i16,
27570 #[doc = "Z Magnetic field"]
27571 pub zmag: i16,
27572 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27573 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27574 pub temperature: i16,
27575}
27576impl SCALED_IMU2_DATA {
27577 pub const ENCODED_LEN: usize = 24usize;
27578 pub const DEFAULT: Self = Self {
27579 time_boot_ms: 0_u32,
27580 xacc: 0_i16,
27581 yacc: 0_i16,
27582 zacc: 0_i16,
27583 xgyro: 0_i16,
27584 ygyro: 0_i16,
27585 zgyro: 0_i16,
27586 xmag: 0_i16,
27587 ymag: 0_i16,
27588 zmag: 0_i16,
27589 temperature: 0_i16,
27590 };
27591 #[cfg(feature = "arbitrary")]
27592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27593 use arbitrary::{Arbitrary, Unstructured};
27594 let mut buf = [0u8; 1024];
27595 rng.fill_bytes(&mut buf);
27596 let mut unstructured = Unstructured::new(&buf);
27597 Self::arbitrary(&mut unstructured).unwrap_or_default()
27598 }
27599}
27600impl Default for SCALED_IMU2_DATA {
27601 fn default() -> Self {
27602 Self::DEFAULT.clone()
27603 }
27604}
27605impl MessageData for SCALED_IMU2_DATA {
27606 type Message = MavMessage;
27607 const ID: u32 = 116u32;
27608 const NAME: &'static str = "SCALED_IMU2";
27609 const EXTRA_CRC: u8 = 76u8;
27610 const ENCODED_LEN: usize = 24usize;
27611 fn deser(
27612 _version: MavlinkVersion,
27613 __input: &[u8],
27614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27615 let avail_len = __input.len();
27616 let mut payload_buf = [0; Self::ENCODED_LEN];
27617 let mut buf = if avail_len < Self::ENCODED_LEN {
27618 payload_buf[0..avail_len].copy_from_slice(__input);
27619 Bytes::new(&payload_buf)
27620 } else {
27621 Bytes::new(__input)
27622 };
27623 let mut __struct = Self::default();
27624 __struct.time_boot_ms = buf.get_u32_le()?;
27625 __struct.xacc = buf.get_i16_le()?;
27626 __struct.yacc = buf.get_i16_le()?;
27627 __struct.zacc = buf.get_i16_le()?;
27628 __struct.xgyro = buf.get_i16_le()?;
27629 __struct.ygyro = buf.get_i16_le()?;
27630 __struct.zgyro = buf.get_i16_le()?;
27631 __struct.xmag = buf.get_i16_le()?;
27632 __struct.ymag = buf.get_i16_le()?;
27633 __struct.zmag = buf.get_i16_le()?;
27634 __struct.temperature = buf.get_i16_le()?;
27635 Ok(__struct)
27636 }
27637 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27638 let mut __tmp = BytesMut::new(bytes);
27639 #[allow(clippy::absurd_extreme_comparisons)]
27640 #[allow(unused_comparisons)]
27641 if __tmp.remaining() < Self::ENCODED_LEN {
27642 panic!(
27643 "buffer is too small (need {} bytes, but got {})",
27644 Self::ENCODED_LEN,
27645 __tmp.remaining(),
27646 )
27647 }
27648 __tmp.put_u32_le(self.time_boot_ms);
27649 __tmp.put_i16_le(self.xacc);
27650 __tmp.put_i16_le(self.yacc);
27651 __tmp.put_i16_le(self.zacc);
27652 __tmp.put_i16_le(self.xgyro);
27653 __tmp.put_i16_le(self.ygyro);
27654 __tmp.put_i16_le(self.zgyro);
27655 __tmp.put_i16_le(self.xmag);
27656 __tmp.put_i16_le(self.ymag);
27657 __tmp.put_i16_le(self.zmag);
27658 if matches!(version, MavlinkVersion::V2) {
27659 __tmp.put_i16_le(self.temperature);
27660 let len = __tmp.len();
27661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27662 } else {
27663 __tmp.len()
27664 }
27665 }
27666}
27667#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27668#[doc = ""]
27669#[doc = "ID: 129"]
27670#[derive(Debug, Clone, PartialEq)]
27671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27673#[cfg_attr(feature = "ts", derive(TS))]
27674#[cfg_attr(feature = "ts", ts(export))]
27675pub struct SCALED_IMU3_DATA {
27676 #[doc = "Timestamp (time since system boot)."]
27677 pub time_boot_ms: u32,
27678 #[doc = "X acceleration"]
27679 pub xacc: i16,
27680 #[doc = "Y acceleration"]
27681 pub yacc: i16,
27682 #[doc = "Z acceleration"]
27683 pub zacc: i16,
27684 #[doc = "Angular speed around X axis"]
27685 pub xgyro: i16,
27686 #[doc = "Angular speed around Y axis"]
27687 pub ygyro: i16,
27688 #[doc = "Angular speed around Z axis"]
27689 pub zgyro: i16,
27690 #[doc = "X Magnetic field"]
27691 pub xmag: i16,
27692 #[doc = "Y Magnetic field"]
27693 pub ymag: i16,
27694 #[doc = "Z Magnetic field"]
27695 pub zmag: i16,
27696 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27698 pub temperature: i16,
27699}
27700impl SCALED_IMU3_DATA {
27701 pub const ENCODED_LEN: usize = 24usize;
27702 pub const DEFAULT: Self = Self {
27703 time_boot_ms: 0_u32,
27704 xacc: 0_i16,
27705 yacc: 0_i16,
27706 zacc: 0_i16,
27707 xgyro: 0_i16,
27708 ygyro: 0_i16,
27709 zgyro: 0_i16,
27710 xmag: 0_i16,
27711 ymag: 0_i16,
27712 zmag: 0_i16,
27713 temperature: 0_i16,
27714 };
27715 #[cfg(feature = "arbitrary")]
27716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27717 use arbitrary::{Arbitrary, Unstructured};
27718 let mut buf = [0u8; 1024];
27719 rng.fill_bytes(&mut buf);
27720 let mut unstructured = Unstructured::new(&buf);
27721 Self::arbitrary(&mut unstructured).unwrap_or_default()
27722 }
27723}
27724impl Default for SCALED_IMU3_DATA {
27725 fn default() -> Self {
27726 Self::DEFAULT.clone()
27727 }
27728}
27729impl MessageData for SCALED_IMU3_DATA {
27730 type Message = MavMessage;
27731 const ID: u32 = 129u32;
27732 const NAME: &'static str = "SCALED_IMU3";
27733 const EXTRA_CRC: u8 = 46u8;
27734 const ENCODED_LEN: usize = 24usize;
27735 fn deser(
27736 _version: MavlinkVersion,
27737 __input: &[u8],
27738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27739 let avail_len = __input.len();
27740 let mut payload_buf = [0; Self::ENCODED_LEN];
27741 let mut buf = if avail_len < Self::ENCODED_LEN {
27742 payload_buf[0..avail_len].copy_from_slice(__input);
27743 Bytes::new(&payload_buf)
27744 } else {
27745 Bytes::new(__input)
27746 };
27747 let mut __struct = Self::default();
27748 __struct.time_boot_ms = buf.get_u32_le()?;
27749 __struct.xacc = buf.get_i16_le()?;
27750 __struct.yacc = buf.get_i16_le()?;
27751 __struct.zacc = buf.get_i16_le()?;
27752 __struct.xgyro = buf.get_i16_le()?;
27753 __struct.ygyro = buf.get_i16_le()?;
27754 __struct.zgyro = buf.get_i16_le()?;
27755 __struct.xmag = buf.get_i16_le()?;
27756 __struct.ymag = buf.get_i16_le()?;
27757 __struct.zmag = buf.get_i16_le()?;
27758 __struct.temperature = buf.get_i16_le()?;
27759 Ok(__struct)
27760 }
27761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27762 let mut __tmp = BytesMut::new(bytes);
27763 #[allow(clippy::absurd_extreme_comparisons)]
27764 #[allow(unused_comparisons)]
27765 if __tmp.remaining() < Self::ENCODED_LEN {
27766 panic!(
27767 "buffer is too small (need {} bytes, but got {})",
27768 Self::ENCODED_LEN,
27769 __tmp.remaining(),
27770 )
27771 }
27772 __tmp.put_u32_le(self.time_boot_ms);
27773 __tmp.put_i16_le(self.xacc);
27774 __tmp.put_i16_le(self.yacc);
27775 __tmp.put_i16_le(self.zacc);
27776 __tmp.put_i16_le(self.xgyro);
27777 __tmp.put_i16_le(self.ygyro);
27778 __tmp.put_i16_le(self.zgyro);
27779 __tmp.put_i16_le(self.xmag);
27780 __tmp.put_i16_le(self.ymag);
27781 __tmp.put_i16_le(self.zmag);
27782 if matches!(version, MavlinkVersion::V2) {
27783 __tmp.put_i16_le(self.temperature);
27784 let len = __tmp.len();
27785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27786 } else {
27787 __tmp.len()
27788 }
27789 }
27790}
27791#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27792#[doc = ""]
27793#[doc = "ID: 29"]
27794#[derive(Debug, Clone, PartialEq)]
27795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27797#[cfg_attr(feature = "ts", derive(TS))]
27798#[cfg_attr(feature = "ts", ts(export))]
27799pub struct SCALED_PRESSURE_DATA {
27800 #[doc = "Timestamp (time since system boot)."]
27801 pub time_boot_ms: u32,
27802 #[doc = "Absolute pressure"]
27803 pub press_abs: f32,
27804 #[doc = "Differential pressure 1"]
27805 pub press_diff: f32,
27806 #[doc = "Absolute pressure temperature"]
27807 pub temperature: i16,
27808 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27810 pub temperature_press_diff: i16,
27811}
27812impl SCALED_PRESSURE_DATA {
27813 pub const ENCODED_LEN: usize = 16usize;
27814 pub const DEFAULT: Self = Self {
27815 time_boot_ms: 0_u32,
27816 press_abs: 0.0_f32,
27817 press_diff: 0.0_f32,
27818 temperature: 0_i16,
27819 temperature_press_diff: 0_i16,
27820 };
27821 #[cfg(feature = "arbitrary")]
27822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27823 use arbitrary::{Arbitrary, Unstructured};
27824 let mut buf = [0u8; 1024];
27825 rng.fill_bytes(&mut buf);
27826 let mut unstructured = Unstructured::new(&buf);
27827 Self::arbitrary(&mut unstructured).unwrap_or_default()
27828 }
27829}
27830impl Default for SCALED_PRESSURE_DATA {
27831 fn default() -> Self {
27832 Self::DEFAULT.clone()
27833 }
27834}
27835impl MessageData for SCALED_PRESSURE_DATA {
27836 type Message = MavMessage;
27837 const ID: u32 = 29u32;
27838 const NAME: &'static str = "SCALED_PRESSURE";
27839 const EXTRA_CRC: u8 = 115u8;
27840 const ENCODED_LEN: usize = 16usize;
27841 fn deser(
27842 _version: MavlinkVersion,
27843 __input: &[u8],
27844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27845 let avail_len = __input.len();
27846 let mut payload_buf = [0; Self::ENCODED_LEN];
27847 let mut buf = if avail_len < Self::ENCODED_LEN {
27848 payload_buf[0..avail_len].copy_from_slice(__input);
27849 Bytes::new(&payload_buf)
27850 } else {
27851 Bytes::new(__input)
27852 };
27853 let mut __struct = Self::default();
27854 __struct.time_boot_ms = buf.get_u32_le()?;
27855 __struct.press_abs = buf.get_f32_le()?;
27856 __struct.press_diff = buf.get_f32_le()?;
27857 __struct.temperature = buf.get_i16_le()?;
27858 __struct.temperature_press_diff = buf.get_i16_le()?;
27859 Ok(__struct)
27860 }
27861 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27862 let mut __tmp = BytesMut::new(bytes);
27863 #[allow(clippy::absurd_extreme_comparisons)]
27864 #[allow(unused_comparisons)]
27865 if __tmp.remaining() < Self::ENCODED_LEN {
27866 panic!(
27867 "buffer is too small (need {} bytes, but got {})",
27868 Self::ENCODED_LEN,
27869 __tmp.remaining(),
27870 )
27871 }
27872 __tmp.put_u32_le(self.time_boot_ms);
27873 __tmp.put_f32_le(self.press_abs);
27874 __tmp.put_f32_le(self.press_diff);
27875 __tmp.put_i16_le(self.temperature);
27876 if matches!(version, MavlinkVersion::V2) {
27877 __tmp.put_i16_le(self.temperature_press_diff);
27878 let len = __tmp.len();
27879 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27880 } else {
27881 __tmp.len()
27882 }
27883 }
27884}
27885#[doc = "Barometer readings for 2nd barometer."]
27886#[doc = ""]
27887#[doc = "ID: 137"]
27888#[derive(Debug, Clone, PartialEq)]
27889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27891#[cfg_attr(feature = "ts", derive(TS))]
27892#[cfg_attr(feature = "ts", ts(export))]
27893pub struct SCALED_PRESSURE2_DATA {
27894 #[doc = "Timestamp (time since system boot)."]
27895 pub time_boot_ms: u32,
27896 #[doc = "Absolute pressure"]
27897 pub press_abs: f32,
27898 #[doc = "Differential pressure"]
27899 pub press_diff: f32,
27900 #[doc = "Absolute pressure temperature"]
27901 pub temperature: i16,
27902 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27904 pub temperature_press_diff: i16,
27905}
27906impl SCALED_PRESSURE2_DATA {
27907 pub const ENCODED_LEN: usize = 16usize;
27908 pub const DEFAULT: Self = Self {
27909 time_boot_ms: 0_u32,
27910 press_abs: 0.0_f32,
27911 press_diff: 0.0_f32,
27912 temperature: 0_i16,
27913 temperature_press_diff: 0_i16,
27914 };
27915 #[cfg(feature = "arbitrary")]
27916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27917 use arbitrary::{Arbitrary, Unstructured};
27918 let mut buf = [0u8; 1024];
27919 rng.fill_bytes(&mut buf);
27920 let mut unstructured = Unstructured::new(&buf);
27921 Self::arbitrary(&mut unstructured).unwrap_or_default()
27922 }
27923}
27924impl Default for SCALED_PRESSURE2_DATA {
27925 fn default() -> Self {
27926 Self::DEFAULT.clone()
27927 }
27928}
27929impl MessageData for SCALED_PRESSURE2_DATA {
27930 type Message = MavMessage;
27931 const ID: u32 = 137u32;
27932 const NAME: &'static str = "SCALED_PRESSURE2";
27933 const EXTRA_CRC: u8 = 195u8;
27934 const ENCODED_LEN: usize = 16usize;
27935 fn deser(
27936 _version: MavlinkVersion,
27937 __input: &[u8],
27938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27939 let avail_len = __input.len();
27940 let mut payload_buf = [0; Self::ENCODED_LEN];
27941 let mut buf = if avail_len < Self::ENCODED_LEN {
27942 payload_buf[0..avail_len].copy_from_slice(__input);
27943 Bytes::new(&payload_buf)
27944 } else {
27945 Bytes::new(__input)
27946 };
27947 let mut __struct = Self::default();
27948 __struct.time_boot_ms = buf.get_u32_le()?;
27949 __struct.press_abs = buf.get_f32_le()?;
27950 __struct.press_diff = buf.get_f32_le()?;
27951 __struct.temperature = buf.get_i16_le()?;
27952 __struct.temperature_press_diff = buf.get_i16_le()?;
27953 Ok(__struct)
27954 }
27955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27956 let mut __tmp = BytesMut::new(bytes);
27957 #[allow(clippy::absurd_extreme_comparisons)]
27958 #[allow(unused_comparisons)]
27959 if __tmp.remaining() < Self::ENCODED_LEN {
27960 panic!(
27961 "buffer is too small (need {} bytes, but got {})",
27962 Self::ENCODED_LEN,
27963 __tmp.remaining(),
27964 )
27965 }
27966 __tmp.put_u32_le(self.time_boot_ms);
27967 __tmp.put_f32_le(self.press_abs);
27968 __tmp.put_f32_le(self.press_diff);
27969 __tmp.put_i16_le(self.temperature);
27970 if matches!(version, MavlinkVersion::V2) {
27971 __tmp.put_i16_le(self.temperature_press_diff);
27972 let len = __tmp.len();
27973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27974 } else {
27975 __tmp.len()
27976 }
27977 }
27978}
27979#[doc = "Barometer readings for 3rd barometer."]
27980#[doc = ""]
27981#[doc = "ID: 143"]
27982#[derive(Debug, Clone, PartialEq)]
27983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27985#[cfg_attr(feature = "ts", derive(TS))]
27986#[cfg_attr(feature = "ts", ts(export))]
27987pub struct SCALED_PRESSURE3_DATA {
27988 #[doc = "Timestamp (time since system boot)."]
27989 pub time_boot_ms: u32,
27990 #[doc = "Absolute pressure"]
27991 pub press_abs: f32,
27992 #[doc = "Differential pressure"]
27993 pub press_diff: f32,
27994 #[doc = "Absolute pressure temperature"]
27995 pub temperature: i16,
27996 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27997 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27998 pub temperature_press_diff: i16,
27999}
28000impl SCALED_PRESSURE3_DATA {
28001 pub const ENCODED_LEN: usize = 16usize;
28002 pub const DEFAULT: Self = Self {
28003 time_boot_ms: 0_u32,
28004 press_abs: 0.0_f32,
28005 press_diff: 0.0_f32,
28006 temperature: 0_i16,
28007 temperature_press_diff: 0_i16,
28008 };
28009 #[cfg(feature = "arbitrary")]
28010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28011 use arbitrary::{Arbitrary, Unstructured};
28012 let mut buf = [0u8; 1024];
28013 rng.fill_bytes(&mut buf);
28014 let mut unstructured = Unstructured::new(&buf);
28015 Self::arbitrary(&mut unstructured).unwrap_or_default()
28016 }
28017}
28018impl Default for SCALED_PRESSURE3_DATA {
28019 fn default() -> Self {
28020 Self::DEFAULT.clone()
28021 }
28022}
28023impl MessageData for SCALED_PRESSURE3_DATA {
28024 type Message = MavMessage;
28025 const ID: u32 = 143u32;
28026 const NAME: &'static str = "SCALED_PRESSURE3";
28027 const EXTRA_CRC: u8 = 131u8;
28028 const ENCODED_LEN: usize = 16usize;
28029 fn deser(
28030 _version: MavlinkVersion,
28031 __input: &[u8],
28032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28033 let avail_len = __input.len();
28034 let mut payload_buf = [0; Self::ENCODED_LEN];
28035 let mut buf = if avail_len < Self::ENCODED_LEN {
28036 payload_buf[0..avail_len].copy_from_slice(__input);
28037 Bytes::new(&payload_buf)
28038 } else {
28039 Bytes::new(__input)
28040 };
28041 let mut __struct = Self::default();
28042 __struct.time_boot_ms = buf.get_u32_le()?;
28043 __struct.press_abs = buf.get_f32_le()?;
28044 __struct.press_diff = buf.get_f32_le()?;
28045 __struct.temperature = buf.get_i16_le()?;
28046 __struct.temperature_press_diff = buf.get_i16_le()?;
28047 Ok(__struct)
28048 }
28049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28050 let mut __tmp = BytesMut::new(bytes);
28051 #[allow(clippy::absurd_extreme_comparisons)]
28052 #[allow(unused_comparisons)]
28053 if __tmp.remaining() < Self::ENCODED_LEN {
28054 panic!(
28055 "buffer is too small (need {} bytes, but got {})",
28056 Self::ENCODED_LEN,
28057 __tmp.remaining(),
28058 )
28059 }
28060 __tmp.put_u32_le(self.time_boot_ms);
28061 __tmp.put_f32_le(self.press_abs);
28062 __tmp.put_f32_le(self.press_diff);
28063 __tmp.put_i16_le(self.temperature);
28064 if matches!(version, MavlinkVersion::V2) {
28065 __tmp.put_i16_le(self.temperature_press_diff);
28066 let len = __tmp.len();
28067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28068 } else {
28069 __tmp.len()
28070 }
28071 }
28072}
28073#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
28074#[doc = ""]
28075#[doc = "ID: 126"]
28076#[derive(Debug, Clone, PartialEq)]
28077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28079#[cfg_attr(feature = "ts", derive(TS))]
28080#[cfg_attr(feature = "ts", ts(export))]
28081pub struct SERIAL_CONTROL_DATA {
28082 #[doc = "Baudrate of transfer. Zero means no change."]
28083 pub baudrate: u32,
28084 #[doc = "Timeout for reply data"]
28085 pub timeout: u16,
28086 #[doc = "Serial control device type."]
28087 pub device: SerialControlDev,
28088 #[doc = "Bitmap of serial control flags."]
28089 pub flags: SerialControlFlag,
28090 #[doc = "how many bytes in this transfer"]
28091 pub count: u8,
28092 #[doc = "serial data"]
28093 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28094 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28095 pub data: [u8; 70],
28096 #[doc = "System ID"]
28097 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28098 pub target_system: u8,
28099 #[doc = "Component ID"]
28100 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28101 pub target_component: u8,
28102}
28103impl SERIAL_CONTROL_DATA {
28104 pub const ENCODED_LEN: usize = 81usize;
28105 pub const DEFAULT: Self = Self {
28106 baudrate: 0_u32,
28107 timeout: 0_u16,
28108 device: SerialControlDev::DEFAULT,
28109 flags: SerialControlFlag::DEFAULT,
28110 count: 0_u8,
28111 data: [0_u8; 70usize],
28112 target_system: 0_u8,
28113 target_component: 0_u8,
28114 };
28115 #[cfg(feature = "arbitrary")]
28116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28117 use arbitrary::{Arbitrary, Unstructured};
28118 let mut buf = [0u8; 1024];
28119 rng.fill_bytes(&mut buf);
28120 let mut unstructured = Unstructured::new(&buf);
28121 Self::arbitrary(&mut unstructured).unwrap_or_default()
28122 }
28123}
28124impl Default for SERIAL_CONTROL_DATA {
28125 fn default() -> Self {
28126 Self::DEFAULT.clone()
28127 }
28128}
28129impl MessageData for SERIAL_CONTROL_DATA {
28130 type Message = MavMessage;
28131 const ID: u32 = 126u32;
28132 const NAME: &'static str = "SERIAL_CONTROL";
28133 const EXTRA_CRC: u8 = 220u8;
28134 const ENCODED_LEN: usize = 81usize;
28135 fn deser(
28136 _version: MavlinkVersion,
28137 __input: &[u8],
28138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28139 let avail_len = __input.len();
28140 let mut payload_buf = [0; Self::ENCODED_LEN];
28141 let mut buf = if avail_len < Self::ENCODED_LEN {
28142 payload_buf[0..avail_len].copy_from_slice(__input);
28143 Bytes::new(&payload_buf)
28144 } else {
28145 Bytes::new(__input)
28146 };
28147 let mut __struct = Self::default();
28148 __struct.baudrate = buf.get_u32_le()?;
28149 __struct.timeout = buf.get_u16_le()?;
28150 let tmp = buf.get_u8()?;
28151 __struct.device =
28152 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28153 enum_type: "SerialControlDev",
28154 value: tmp as u64,
28155 })?;
28156 let tmp = buf.get_u8()?;
28157 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
28158 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28159 flag_type: "SerialControlFlag",
28160 value: tmp as u64,
28161 })?;
28162 __struct.count = buf.get_u8()?;
28163 for v in &mut __struct.data {
28164 let val = buf.get_u8()?;
28165 *v = val;
28166 }
28167 __struct.target_system = buf.get_u8()?;
28168 __struct.target_component = buf.get_u8()?;
28169 Ok(__struct)
28170 }
28171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28172 let mut __tmp = BytesMut::new(bytes);
28173 #[allow(clippy::absurd_extreme_comparisons)]
28174 #[allow(unused_comparisons)]
28175 if __tmp.remaining() < Self::ENCODED_LEN {
28176 panic!(
28177 "buffer is too small (need {} bytes, but got {})",
28178 Self::ENCODED_LEN,
28179 __tmp.remaining(),
28180 )
28181 }
28182 __tmp.put_u32_le(self.baudrate);
28183 __tmp.put_u16_le(self.timeout);
28184 __tmp.put_u8(self.device as u8);
28185 __tmp.put_u8(self.flags.bits() as u8);
28186 __tmp.put_u8(self.count);
28187 for val in &self.data {
28188 __tmp.put_u8(*val);
28189 }
28190 if matches!(version, MavlinkVersion::V2) {
28191 __tmp.put_u8(self.target_system);
28192 __tmp.put_u8(self.target_component);
28193 let len = __tmp.len();
28194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28195 } else {
28196 __tmp.len()
28197 }
28198 }
28199}
28200#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
28201#[doc = ""]
28202#[doc = "ID: 36"]
28203#[derive(Debug, Clone, PartialEq)]
28204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28206#[cfg_attr(feature = "ts", derive(TS))]
28207#[cfg_attr(feature = "ts", ts(export))]
28208pub struct SERVO_OUTPUT_RAW_DATA {
28209 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28210 pub time_usec: u32,
28211 #[doc = "Servo output 1 value"]
28212 pub servo1_raw: u16,
28213 #[doc = "Servo output 2 value"]
28214 pub servo2_raw: u16,
28215 #[doc = "Servo output 3 value"]
28216 pub servo3_raw: u16,
28217 #[doc = "Servo output 4 value"]
28218 pub servo4_raw: u16,
28219 #[doc = "Servo output 5 value"]
28220 pub servo5_raw: u16,
28221 #[doc = "Servo output 6 value"]
28222 pub servo6_raw: u16,
28223 #[doc = "Servo output 7 value"]
28224 pub servo7_raw: u16,
28225 #[doc = "Servo output 8 value"]
28226 pub servo8_raw: u16,
28227 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
28228 pub port: u8,
28229 #[doc = "Servo output 9 value"]
28230 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28231 pub servo9_raw: u16,
28232 #[doc = "Servo output 10 value"]
28233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28234 pub servo10_raw: u16,
28235 #[doc = "Servo output 11 value"]
28236 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28237 pub servo11_raw: u16,
28238 #[doc = "Servo output 12 value"]
28239 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28240 pub servo12_raw: u16,
28241 #[doc = "Servo output 13 value"]
28242 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28243 pub servo13_raw: u16,
28244 #[doc = "Servo output 14 value"]
28245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28246 pub servo14_raw: u16,
28247 #[doc = "Servo output 15 value"]
28248 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28249 pub servo15_raw: u16,
28250 #[doc = "Servo output 16 value"]
28251 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28252 pub servo16_raw: u16,
28253}
28254impl SERVO_OUTPUT_RAW_DATA {
28255 pub const ENCODED_LEN: usize = 37usize;
28256 pub const DEFAULT: Self = Self {
28257 time_usec: 0_u32,
28258 servo1_raw: 0_u16,
28259 servo2_raw: 0_u16,
28260 servo3_raw: 0_u16,
28261 servo4_raw: 0_u16,
28262 servo5_raw: 0_u16,
28263 servo6_raw: 0_u16,
28264 servo7_raw: 0_u16,
28265 servo8_raw: 0_u16,
28266 port: 0_u8,
28267 servo9_raw: 0_u16,
28268 servo10_raw: 0_u16,
28269 servo11_raw: 0_u16,
28270 servo12_raw: 0_u16,
28271 servo13_raw: 0_u16,
28272 servo14_raw: 0_u16,
28273 servo15_raw: 0_u16,
28274 servo16_raw: 0_u16,
28275 };
28276 #[cfg(feature = "arbitrary")]
28277 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28278 use arbitrary::{Arbitrary, Unstructured};
28279 let mut buf = [0u8; 1024];
28280 rng.fill_bytes(&mut buf);
28281 let mut unstructured = Unstructured::new(&buf);
28282 Self::arbitrary(&mut unstructured).unwrap_or_default()
28283 }
28284}
28285impl Default for SERVO_OUTPUT_RAW_DATA {
28286 fn default() -> Self {
28287 Self::DEFAULT.clone()
28288 }
28289}
28290impl MessageData for SERVO_OUTPUT_RAW_DATA {
28291 type Message = MavMessage;
28292 const ID: u32 = 36u32;
28293 const NAME: &'static str = "SERVO_OUTPUT_RAW";
28294 const EXTRA_CRC: u8 = 222u8;
28295 const ENCODED_LEN: usize = 37usize;
28296 fn deser(
28297 _version: MavlinkVersion,
28298 __input: &[u8],
28299 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28300 let avail_len = __input.len();
28301 let mut payload_buf = [0; Self::ENCODED_LEN];
28302 let mut buf = if avail_len < Self::ENCODED_LEN {
28303 payload_buf[0..avail_len].copy_from_slice(__input);
28304 Bytes::new(&payload_buf)
28305 } else {
28306 Bytes::new(__input)
28307 };
28308 let mut __struct = Self::default();
28309 __struct.time_usec = buf.get_u32_le()?;
28310 __struct.servo1_raw = buf.get_u16_le()?;
28311 __struct.servo2_raw = buf.get_u16_le()?;
28312 __struct.servo3_raw = buf.get_u16_le()?;
28313 __struct.servo4_raw = buf.get_u16_le()?;
28314 __struct.servo5_raw = buf.get_u16_le()?;
28315 __struct.servo6_raw = buf.get_u16_le()?;
28316 __struct.servo7_raw = buf.get_u16_le()?;
28317 __struct.servo8_raw = buf.get_u16_le()?;
28318 __struct.port = buf.get_u8()?;
28319 __struct.servo9_raw = buf.get_u16_le()?;
28320 __struct.servo10_raw = buf.get_u16_le()?;
28321 __struct.servo11_raw = buf.get_u16_le()?;
28322 __struct.servo12_raw = buf.get_u16_le()?;
28323 __struct.servo13_raw = buf.get_u16_le()?;
28324 __struct.servo14_raw = buf.get_u16_le()?;
28325 __struct.servo15_raw = buf.get_u16_le()?;
28326 __struct.servo16_raw = buf.get_u16_le()?;
28327 Ok(__struct)
28328 }
28329 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28330 let mut __tmp = BytesMut::new(bytes);
28331 #[allow(clippy::absurd_extreme_comparisons)]
28332 #[allow(unused_comparisons)]
28333 if __tmp.remaining() < Self::ENCODED_LEN {
28334 panic!(
28335 "buffer is too small (need {} bytes, but got {})",
28336 Self::ENCODED_LEN,
28337 __tmp.remaining(),
28338 )
28339 }
28340 __tmp.put_u32_le(self.time_usec);
28341 __tmp.put_u16_le(self.servo1_raw);
28342 __tmp.put_u16_le(self.servo2_raw);
28343 __tmp.put_u16_le(self.servo3_raw);
28344 __tmp.put_u16_le(self.servo4_raw);
28345 __tmp.put_u16_le(self.servo5_raw);
28346 __tmp.put_u16_le(self.servo6_raw);
28347 __tmp.put_u16_le(self.servo7_raw);
28348 __tmp.put_u16_le(self.servo8_raw);
28349 __tmp.put_u8(self.port);
28350 if matches!(version, MavlinkVersion::V2) {
28351 __tmp.put_u16_le(self.servo9_raw);
28352 __tmp.put_u16_le(self.servo10_raw);
28353 __tmp.put_u16_le(self.servo11_raw);
28354 __tmp.put_u16_le(self.servo12_raw);
28355 __tmp.put_u16_le(self.servo13_raw);
28356 __tmp.put_u16_le(self.servo14_raw);
28357 __tmp.put_u16_le(self.servo15_raw);
28358 __tmp.put_u16_le(self.servo16_raw);
28359 let len = __tmp.len();
28360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28361 } else {
28362 __tmp.len()
28363 }
28364 }
28365}
28366#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
28367#[doc = ""]
28368#[doc = "ID: 256"]
28369#[derive(Debug, Clone, PartialEq)]
28370#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28372#[cfg_attr(feature = "ts", derive(TS))]
28373#[cfg_attr(feature = "ts", ts(export))]
28374pub struct SETUP_SIGNING_DATA {
28375 #[doc = "initial timestamp"]
28376 pub initial_timestamp: u64,
28377 #[doc = "system id of the target"]
28378 pub target_system: u8,
28379 #[doc = "component ID of the target"]
28380 pub target_component: u8,
28381 #[doc = "signing key"]
28382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28383 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28384 pub secret_key: [u8; 32],
28385}
28386impl SETUP_SIGNING_DATA {
28387 pub const ENCODED_LEN: usize = 42usize;
28388 pub const DEFAULT: Self = Self {
28389 initial_timestamp: 0_u64,
28390 target_system: 0_u8,
28391 target_component: 0_u8,
28392 secret_key: [0_u8; 32usize],
28393 };
28394 #[cfg(feature = "arbitrary")]
28395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28396 use arbitrary::{Arbitrary, Unstructured};
28397 let mut buf = [0u8; 1024];
28398 rng.fill_bytes(&mut buf);
28399 let mut unstructured = Unstructured::new(&buf);
28400 Self::arbitrary(&mut unstructured).unwrap_or_default()
28401 }
28402}
28403impl Default for SETUP_SIGNING_DATA {
28404 fn default() -> Self {
28405 Self::DEFAULT.clone()
28406 }
28407}
28408impl MessageData for SETUP_SIGNING_DATA {
28409 type Message = MavMessage;
28410 const ID: u32 = 256u32;
28411 const NAME: &'static str = "SETUP_SIGNING";
28412 const EXTRA_CRC: u8 = 71u8;
28413 const ENCODED_LEN: usize = 42usize;
28414 fn deser(
28415 _version: MavlinkVersion,
28416 __input: &[u8],
28417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28418 let avail_len = __input.len();
28419 let mut payload_buf = [0; Self::ENCODED_LEN];
28420 let mut buf = if avail_len < Self::ENCODED_LEN {
28421 payload_buf[0..avail_len].copy_from_slice(__input);
28422 Bytes::new(&payload_buf)
28423 } else {
28424 Bytes::new(__input)
28425 };
28426 let mut __struct = Self::default();
28427 __struct.initial_timestamp = buf.get_u64_le()?;
28428 __struct.target_system = buf.get_u8()?;
28429 __struct.target_component = buf.get_u8()?;
28430 for v in &mut __struct.secret_key {
28431 let val = buf.get_u8()?;
28432 *v = val;
28433 }
28434 Ok(__struct)
28435 }
28436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28437 let mut __tmp = BytesMut::new(bytes);
28438 #[allow(clippy::absurd_extreme_comparisons)]
28439 #[allow(unused_comparisons)]
28440 if __tmp.remaining() < Self::ENCODED_LEN {
28441 panic!(
28442 "buffer is too small (need {} bytes, but got {})",
28443 Self::ENCODED_LEN,
28444 __tmp.remaining(),
28445 )
28446 }
28447 __tmp.put_u64_le(self.initial_timestamp);
28448 __tmp.put_u8(self.target_system);
28449 __tmp.put_u8(self.target_component);
28450 for val in &self.secret_key {
28451 __tmp.put_u8(*val);
28452 }
28453 if matches!(version, MavlinkVersion::V2) {
28454 let len = __tmp.len();
28455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28456 } else {
28457 __tmp.len()
28458 }
28459 }
28460}
28461#[doc = "Set the vehicle attitude and body angular rates."]
28462#[doc = ""]
28463#[doc = "ID: 139"]
28464#[derive(Debug, Clone, PartialEq)]
28465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28467#[cfg_attr(feature = "ts", derive(TS))]
28468#[cfg_attr(feature = "ts", ts(export))]
28469pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28470 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28471 pub time_usec: u64,
28472 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28474 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28475 pub controls: [f32; 8],
28476 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28477 pub group_mlx: u8,
28478 #[doc = "System ID"]
28479 pub target_system: u8,
28480 #[doc = "Component ID"]
28481 pub target_component: u8,
28482}
28483impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28484 pub const ENCODED_LEN: usize = 43usize;
28485 pub const DEFAULT: Self = Self {
28486 time_usec: 0_u64,
28487 controls: [0.0_f32; 8usize],
28488 group_mlx: 0_u8,
28489 target_system: 0_u8,
28490 target_component: 0_u8,
28491 };
28492 #[cfg(feature = "arbitrary")]
28493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28494 use arbitrary::{Arbitrary, Unstructured};
28495 let mut buf = [0u8; 1024];
28496 rng.fill_bytes(&mut buf);
28497 let mut unstructured = Unstructured::new(&buf);
28498 Self::arbitrary(&mut unstructured).unwrap_or_default()
28499 }
28500}
28501impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28502 fn default() -> Self {
28503 Self::DEFAULT.clone()
28504 }
28505}
28506impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28507 type Message = MavMessage;
28508 const ID: u32 = 139u32;
28509 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28510 const EXTRA_CRC: u8 = 168u8;
28511 const ENCODED_LEN: usize = 43usize;
28512 fn deser(
28513 _version: MavlinkVersion,
28514 __input: &[u8],
28515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28516 let avail_len = __input.len();
28517 let mut payload_buf = [0; Self::ENCODED_LEN];
28518 let mut buf = if avail_len < Self::ENCODED_LEN {
28519 payload_buf[0..avail_len].copy_from_slice(__input);
28520 Bytes::new(&payload_buf)
28521 } else {
28522 Bytes::new(__input)
28523 };
28524 let mut __struct = Self::default();
28525 __struct.time_usec = buf.get_u64_le()?;
28526 for v in &mut __struct.controls {
28527 let val = buf.get_f32_le()?;
28528 *v = val;
28529 }
28530 __struct.group_mlx = buf.get_u8()?;
28531 __struct.target_system = buf.get_u8()?;
28532 __struct.target_component = buf.get_u8()?;
28533 Ok(__struct)
28534 }
28535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28536 let mut __tmp = BytesMut::new(bytes);
28537 #[allow(clippy::absurd_extreme_comparisons)]
28538 #[allow(unused_comparisons)]
28539 if __tmp.remaining() < Self::ENCODED_LEN {
28540 panic!(
28541 "buffer is too small (need {} bytes, but got {})",
28542 Self::ENCODED_LEN,
28543 __tmp.remaining(),
28544 )
28545 }
28546 __tmp.put_u64_le(self.time_usec);
28547 for val in &self.controls {
28548 __tmp.put_f32_le(*val);
28549 }
28550 __tmp.put_u8(self.group_mlx);
28551 __tmp.put_u8(self.target_system);
28552 __tmp.put_u8(self.target_component);
28553 if matches!(version, MavlinkVersion::V2) {
28554 let len = __tmp.len();
28555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28556 } else {
28557 __tmp.len()
28558 }
28559 }
28560}
28561#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28562#[doc = ""]
28563#[doc = "ID: 82"]
28564#[derive(Debug, Clone, PartialEq)]
28565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28567#[cfg_attr(feature = "ts", derive(TS))]
28568#[cfg_attr(feature = "ts", ts(export))]
28569pub struct SET_ATTITUDE_TARGET_DATA {
28570 #[doc = "Timestamp (time since system boot)."]
28571 pub time_boot_ms: u32,
28572 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28574 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28575 pub q: [f32; 4],
28576 #[doc = "Body roll rate"]
28577 pub body_roll_rate: f32,
28578 #[doc = "Body pitch rate"]
28579 pub body_pitch_rate: f32,
28580 #[doc = "Body yaw rate"]
28581 pub body_yaw_rate: f32,
28582 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28583 pub thrust: f32,
28584 #[doc = "System ID"]
28585 pub target_system: u8,
28586 #[doc = "Component ID"]
28587 pub target_component: u8,
28588 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28589 pub type_mask: AttitudeTargetTypemask,
28590 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28593 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28594 pub thrust_body: [f32; 3],
28595}
28596impl SET_ATTITUDE_TARGET_DATA {
28597 pub const ENCODED_LEN: usize = 51usize;
28598 pub const DEFAULT: Self = Self {
28599 time_boot_ms: 0_u32,
28600 q: [0.0_f32; 4usize],
28601 body_roll_rate: 0.0_f32,
28602 body_pitch_rate: 0.0_f32,
28603 body_yaw_rate: 0.0_f32,
28604 thrust: 0.0_f32,
28605 target_system: 0_u8,
28606 target_component: 0_u8,
28607 type_mask: AttitudeTargetTypemask::DEFAULT,
28608 thrust_body: [0.0_f32; 3usize],
28609 };
28610 #[cfg(feature = "arbitrary")]
28611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28612 use arbitrary::{Arbitrary, Unstructured};
28613 let mut buf = [0u8; 1024];
28614 rng.fill_bytes(&mut buf);
28615 let mut unstructured = Unstructured::new(&buf);
28616 Self::arbitrary(&mut unstructured).unwrap_or_default()
28617 }
28618}
28619impl Default for SET_ATTITUDE_TARGET_DATA {
28620 fn default() -> Self {
28621 Self::DEFAULT.clone()
28622 }
28623}
28624impl MessageData for SET_ATTITUDE_TARGET_DATA {
28625 type Message = MavMessage;
28626 const ID: u32 = 82u32;
28627 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28628 const EXTRA_CRC: u8 = 49u8;
28629 const ENCODED_LEN: usize = 51usize;
28630 fn deser(
28631 _version: MavlinkVersion,
28632 __input: &[u8],
28633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28634 let avail_len = __input.len();
28635 let mut payload_buf = [0; Self::ENCODED_LEN];
28636 let mut buf = if avail_len < Self::ENCODED_LEN {
28637 payload_buf[0..avail_len].copy_from_slice(__input);
28638 Bytes::new(&payload_buf)
28639 } else {
28640 Bytes::new(__input)
28641 };
28642 let mut __struct = Self::default();
28643 __struct.time_boot_ms = buf.get_u32_le()?;
28644 for v in &mut __struct.q {
28645 let val = buf.get_f32_le()?;
28646 *v = val;
28647 }
28648 __struct.body_roll_rate = buf.get_f32_le()?;
28649 __struct.body_pitch_rate = buf.get_f32_le()?;
28650 __struct.body_yaw_rate = buf.get_f32_le()?;
28651 __struct.thrust = buf.get_f32_le()?;
28652 __struct.target_system = buf.get_u8()?;
28653 __struct.target_component = buf.get_u8()?;
28654 let tmp = buf.get_u8()?;
28655 __struct.type_mask =
28656 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
28657 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28658 flag_type: "AttitudeTargetTypemask",
28659 value: tmp as u64,
28660 })?;
28661 for v in &mut __struct.thrust_body {
28662 let val = buf.get_f32_le()?;
28663 *v = val;
28664 }
28665 Ok(__struct)
28666 }
28667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28668 let mut __tmp = BytesMut::new(bytes);
28669 #[allow(clippy::absurd_extreme_comparisons)]
28670 #[allow(unused_comparisons)]
28671 if __tmp.remaining() < Self::ENCODED_LEN {
28672 panic!(
28673 "buffer is too small (need {} bytes, but got {})",
28674 Self::ENCODED_LEN,
28675 __tmp.remaining(),
28676 )
28677 }
28678 __tmp.put_u32_le(self.time_boot_ms);
28679 for val in &self.q {
28680 __tmp.put_f32_le(*val);
28681 }
28682 __tmp.put_f32_le(self.body_roll_rate);
28683 __tmp.put_f32_le(self.body_pitch_rate);
28684 __tmp.put_f32_le(self.body_yaw_rate);
28685 __tmp.put_f32_le(self.thrust);
28686 __tmp.put_u8(self.target_system);
28687 __tmp.put_u8(self.target_component);
28688 __tmp.put_u8(self.type_mask.bits() as u8);
28689 if matches!(version, MavlinkVersion::V2) {
28690 for val in &self.thrust_body {
28691 __tmp.put_f32_le(*val);
28692 }
28693 let len = __tmp.len();
28694 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28695 } else {
28696 __tmp.len()
28697 }
28698 }
28699}
28700#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28701#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28702#[doc = ""]
28703#[doc = "ID: 48"]
28704#[derive(Debug, Clone, PartialEq)]
28705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28707#[cfg_attr(feature = "ts", derive(TS))]
28708#[cfg_attr(feature = "ts", ts(export))]
28709pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28710 #[doc = "Latitude (WGS84)"]
28711 pub latitude: i32,
28712 #[doc = "Longitude (WGS84)"]
28713 pub longitude: i32,
28714 #[doc = "Altitude (MSL). Positive for up."]
28715 pub altitude: i32,
28716 #[doc = "System ID"]
28717 pub target_system: u8,
28718 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28720 pub time_usec: u64,
28721}
28722impl SET_GPS_GLOBAL_ORIGIN_DATA {
28723 pub const ENCODED_LEN: usize = 21usize;
28724 pub const DEFAULT: Self = Self {
28725 latitude: 0_i32,
28726 longitude: 0_i32,
28727 altitude: 0_i32,
28728 target_system: 0_u8,
28729 time_usec: 0_u64,
28730 };
28731 #[cfg(feature = "arbitrary")]
28732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28733 use arbitrary::{Arbitrary, Unstructured};
28734 let mut buf = [0u8; 1024];
28735 rng.fill_bytes(&mut buf);
28736 let mut unstructured = Unstructured::new(&buf);
28737 Self::arbitrary(&mut unstructured).unwrap_or_default()
28738 }
28739}
28740impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28741 fn default() -> Self {
28742 Self::DEFAULT.clone()
28743 }
28744}
28745impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28746 type Message = MavMessage;
28747 const ID: u32 = 48u32;
28748 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28749 const EXTRA_CRC: u8 = 41u8;
28750 const ENCODED_LEN: usize = 21usize;
28751 fn deser(
28752 _version: MavlinkVersion,
28753 __input: &[u8],
28754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28755 let avail_len = __input.len();
28756 let mut payload_buf = [0; Self::ENCODED_LEN];
28757 let mut buf = if avail_len < Self::ENCODED_LEN {
28758 payload_buf[0..avail_len].copy_from_slice(__input);
28759 Bytes::new(&payload_buf)
28760 } else {
28761 Bytes::new(__input)
28762 };
28763 let mut __struct = Self::default();
28764 __struct.latitude = buf.get_i32_le()?;
28765 __struct.longitude = buf.get_i32_le()?;
28766 __struct.altitude = buf.get_i32_le()?;
28767 __struct.target_system = buf.get_u8()?;
28768 __struct.time_usec = buf.get_u64_le()?;
28769 Ok(__struct)
28770 }
28771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28772 let mut __tmp = BytesMut::new(bytes);
28773 #[allow(clippy::absurd_extreme_comparisons)]
28774 #[allow(unused_comparisons)]
28775 if __tmp.remaining() < Self::ENCODED_LEN {
28776 panic!(
28777 "buffer is too small (need {} bytes, but got {})",
28778 Self::ENCODED_LEN,
28779 __tmp.remaining(),
28780 )
28781 }
28782 __tmp.put_i32_le(self.latitude);
28783 __tmp.put_i32_le(self.longitude);
28784 __tmp.put_i32_le(self.altitude);
28785 __tmp.put_u8(self.target_system);
28786 if matches!(version, MavlinkVersion::V2) {
28787 __tmp.put_u64_le(self.time_usec);
28788 let len = __tmp.len();
28789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28790 } else {
28791 __tmp.len()
28792 }
28793 }
28794}
28795#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28796#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28797#[doc = ""]
28798#[doc = "ID: 243"]
28799#[derive(Debug, Clone, PartialEq)]
28800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28802#[cfg_attr(feature = "ts", derive(TS))]
28803#[cfg_attr(feature = "ts", ts(export))]
28804pub struct SET_HOME_POSITION_DATA {
28805 #[doc = "Latitude (WGS84)"]
28806 pub latitude: i32,
28807 #[doc = "Longitude (WGS84)"]
28808 pub longitude: i32,
28809 #[doc = "Altitude (MSL). Positive for up."]
28810 pub altitude: i32,
28811 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28812 pub x: f32,
28813 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28814 pub y: f32,
28815 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28816 pub z: f32,
28817 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28819 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28820 pub q: [f32; 4],
28821 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28822 pub approach_x: f32,
28823 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28824 pub approach_y: f32,
28825 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28826 pub approach_z: f32,
28827 #[doc = "System ID."]
28828 pub target_system: u8,
28829 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28830 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28831 pub time_usec: u64,
28832}
28833impl SET_HOME_POSITION_DATA {
28834 pub const ENCODED_LEN: usize = 61usize;
28835 pub const DEFAULT: Self = Self {
28836 latitude: 0_i32,
28837 longitude: 0_i32,
28838 altitude: 0_i32,
28839 x: 0.0_f32,
28840 y: 0.0_f32,
28841 z: 0.0_f32,
28842 q: [0.0_f32; 4usize],
28843 approach_x: 0.0_f32,
28844 approach_y: 0.0_f32,
28845 approach_z: 0.0_f32,
28846 target_system: 0_u8,
28847 time_usec: 0_u64,
28848 };
28849 #[cfg(feature = "arbitrary")]
28850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28851 use arbitrary::{Arbitrary, Unstructured};
28852 let mut buf = [0u8; 1024];
28853 rng.fill_bytes(&mut buf);
28854 let mut unstructured = Unstructured::new(&buf);
28855 Self::arbitrary(&mut unstructured).unwrap_or_default()
28856 }
28857}
28858impl Default for SET_HOME_POSITION_DATA {
28859 fn default() -> Self {
28860 Self::DEFAULT.clone()
28861 }
28862}
28863impl MessageData for SET_HOME_POSITION_DATA {
28864 type Message = MavMessage;
28865 const ID: u32 = 243u32;
28866 const NAME: &'static str = "SET_HOME_POSITION";
28867 const EXTRA_CRC: u8 = 85u8;
28868 const ENCODED_LEN: usize = 61usize;
28869 fn deser(
28870 _version: MavlinkVersion,
28871 __input: &[u8],
28872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28873 let avail_len = __input.len();
28874 let mut payload_buf = [0; Self::ENCODED_LEN];
28875 let mut buf = if avail_len < Self::ENCODED_LEN {
28876 payload_buf[0..avail_len].copy_from_slice(__input);
28877 Bytes::new(&payload_buf)
28878 } else {
28879 Bytes::new(__input)
28880 };
28881 let mut __struct = Self::default();
28882 __struct.latitude = buf.get_i32_le()?;
28883 __struct.longitude = buf.get_i32_le()?;
28884 __struct.altitude = buf.get_i32_le()?;
28885 __struct.x = buf.get_f32_le()?;
28886 __struct.y = buf.get_f32_le()?;
28887 __struct.z = buf.get_f32_le()?;
28888 for v in &mut __struct.q {
28889 let val = buf.get_f32_le()?;
28890 *v = val;
28891 }
28892 __struct.approach_x = buf.get_f32_le()?;
28893 __struct.approach_y = buf.get_f32_le()?;
28894 __struct.approach_z = buf.get_f32_le()?;
28895 __struct.target_system = buf.get_u8()?;
28896 __struct.time_usec = buf.get_u64_le()?;
28897 Ok(__struct)
28898 }
28899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28900 let mut __tmp = BytesMut::new(bytes);
28901 #[allow(clippy::absurd_extreme_comparisons)]
28902 #[allow(unused_comparisons)]
28903 if __tmp.remaining() < Self::ENCODED_LEN {
28904 panic!(
28905 "buffer is too small (need {} bytes, but got {})",
28906 Self::ENCODED_LEN,
28907 __tmp.remaining(),
28908 )
28909 }
28910 __tmp.put_i32_le(self.latitude);
28911 __tmp.put_i32_le(self.longitude);
28912 __tmp.put_i32_le(self.altitude);
28913 __tmp.put_f32_le(self.x);
28914 __tmp.put_f32_le(self.y);
28915 __tmp.put_f32_le(self.z);
28916 for val in &self.q {
28917 __tmp.put_f32_le(*val);
28918 }
28919 __tmp.put_f32_le(self.approach_x);
28920 __tmp.put_f32_le(self.approach_y);
28921 __tmp.put_f32_le(self.approach_z);
28922 __tmp.put_u8(self.target_system);
28923 if matches!(version, MavlinkVersion::V2) {
28924 __tmp.put_u64_le(self.time_usec);
28925 let len = __tmp.len();
28926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28927 } else {
28928 __tmp.len()
28929 }
28930 }
28931}
28932#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28933#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28934#[doc = ""]
28935#[doc = "ID: 11"]
28936#[derive(Debug, Clone, PartialEq)]
28937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28939#[cfg_attr(feature = "ts", derive(TS))]
28940#[cfg_attr(feature = "ts", ts(export))]
28941pub struct SET_MODE_DATA {
28942 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28943 pub custom_mode: u32,
28944 #[doc = "The system setting the mode"]
28945 pub target_system: u8,
28946 #[doc = "The new base mode."]
28947 pub base_mode: MavMode,
28948}
28949impl SET_MODE_DATA {
28950 pub const ENCODED_LEN: usize = 6usize;
28951 pub const DEFAULT: Self = Self {
28952 custom_mode: 0_u32,
28953 target_system: 0_u8,
28954 base_mode: MavMode::DEFAULT,
28955 };
28956 #[cfg(feature = "arbitrary")]
28957 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28958 use arbitrary::{Arbitrary, Unstructured};
28959 let mut buf = [0u8; 1024];
28960 rng.fill_bytes(&mut buf);
28961 let mut unstructured = Unstructured::new(&buf);
28962 Self::arbitrary(&mut unstructured).unwrap_or_default()
28963 }
28964}
28965impl Default for SET_MODE_DATA {
28966 fn default() -> Self {
28967 Self::DEFAULT.clone()
28968 }
28969}
28970impl MessageData for SET_MODE_DATA {
28971 type Message = MavMessage;
28972 const ID: u32 = 11u32;
28973 const NAME: &'static str = "SET_MODE";
28974 const EXTRA_CRC: u8 = 89u8;
28975 const ENCODED_LEN: usize = 6usize;
28976 fn deser(
28977 _version: MavlinkVersion,
28978 __input: &[u8],
28979 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28980 let avail_len = __input.len();
28981 let mut payload_buf = [0; Self::ENCODED_LEN];
28982 let mut buf = if avail_len < Self::ENCODED_LEN {
28983 payload_buf[0..avail_len].copy_from_slice(__input);
28984 Bytes::new(&payload_buf)
28985 } else {
28986 Bytes::new(__input)
28987 };
28988 let mut __struct = Self::default();
28989 __struct.custom_mode = buf.get_u32_le()?;
28990 __struct.target_system = buf.get_u8()?;
28991 let tmp = buf.get_u8()?;
28992 __struct.base_mode =
28993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28994 enum_type: "MavMode",
28995 value: tmp as u64,
28996 })?;
28997 Ok(__struct)
28998 }
28999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29000 let mut __tmp = BytesMut::new(bytes);
29001 #[allow(clippy::absurd_extreme_comparisons)]
29002 #[allow(unused_comparisons)]
29003 if __tmp.remaining() < Self::ENCODED_LEN {
29004 panic!(
29005 "buffer is too small (need {} bytes, but got {})",
29006 Self::ENCODED_LEN,
29007 __tmp.remaining(),
29008 )
29009 }
29010 __tmp.put_u32_le(self.custom_mode);
29011 __tmp.put_u8(self.target_system);
29012 __tmp.put_u8(self.base_mode as u8);
29013 if matches!(version, MavlinkVersion::V2) {
29014 let len = __tmp.len();
29015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29016 } else {
29017 __tmp.len()
29018 }
29019 }
29020}
29021#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
29022#[doc = ""]
29023#[doc = "ID: 86"]
29024#[derive(Debug, Clone, PartialEq)]
29025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29027#[cfg_attr(feature = "ts", derive(TS))]
29028#[cfg_attr(feature = "ts", ts(export))]
29029pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
29030 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
29031 pub time_boot_ms: u32,
29032 #[doc = "Latitude in WGS84 frame"]
29033 pub lat_int: i32,
29034 #[doc = "Longitude in WGS84 frame"]
29035 pub lon_int: i32,
29036 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
29037 pub alt: f32,
29038 #[doc = "X velocity in NED frame"]
29039 pub vx: f32,
29040 #[doc = "Y velocity in NED frame"]
29041 pub vy: f32,
29042 #[doc = "Z velocity in NED frame"]
29043 pub vz: f32,
29044 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29045 pub afx: f32,
29046 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29047 pub afy: f32,
29048 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29049 pub afz: f32,
29050 #[doc = "yaw setpoint"]
29051 pub yaw: f32,
29052 #[doc = "yaw rate setpoint"]
29053 pub yaw_rate: f32,
29054 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29055 pub type_mask: PositionTargetTypemask,
29056 #[doc = "System ID"]
29057 pub target_system: u8,
29058 #[doc = "Component ID"]
29059 pub target_component: u8,
29060 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
29061 pub coordinate_frame: MavFrame,
29062}
29063impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
29064 pub const ENCODED_LEN: usize = 53usize;
29065 pub const DEFAULT: Self = Self {
29066 time_boot_ms: 0_u32,
29067 lat_int: 0_i32,
29068 lon_int: 0_i32,
29069 alt: 0.0_f32,
29070 vx: 0.0_f32,
29071 vy: 0.0_f32,
29072 vz: 0.0_f32,
29073 afx: 0.0_f32,
29074 afy: 0.0_f32,
29075 afz: 0.0_f32,
29076 yaw: 0.0_f32,
29077 yaw_rate: 0.0_f32,
29078 type_mask: PositionTargetTypemask::DEFAULT,
29079 target_system: 0_u8,
29080 target_component: 0_u8,
29081 coordinate_frame: MavFrame::DEFAULT,
29082 };
29083 #[cfg(feature = "arbitrary")]
29084 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29085 use arbitrary::{Arbitrary, Unstructured};
29086 let mut buf = [0u8; 1024];
29087 rng.fill_bytes(&mut buf);
29088 let mut unstructured = Unstructured::new(&buf);
29089 Self::arbitrary(&mut unstructured).unwrap_or_default()
29090 }
29091}
29092impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
29093 fn default() -> Self {
29094 Self::DEFAULT.clone()
29095 }
29096}
29097impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
29098 type Message = MavMessage;
29099 const ID: u32 = 86u32;
29100 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
29101 const EXTRA_CRC: u8 = 5u8;
29102 const ENCODED_LEN: usize = 53usize;
29103 fn deser(
29104 _version: MavlinkVersion,
29105 __input: &[u8],
29106 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29107 let avail_len = __input.len();
29108 let mut payload_buf = [0; Self::ENCODED_LEN];
29109 let mut buf = if avail_len < Self::ENCODED_LEN {
29110 payload_buf[0..avail_len].copy_from_slice(__input);
29111 Bytes::new(&payload_buf)
29112 } else {
29113 Bytes::new(__input)
29114 };
29115 let mut __struct = Self::default();
29116 __struct.time_boot_ms = buf.get_u32_le()?;
29117 __struct.lat_int = buf.get_i32_le()?;
29118 __struct.lon_int = buf.get_i32_le()?;
29119 __struct.alt = buf.get_f32_le()?;
29120 __struct.vx = buf.get_f32_le()?;
29121 __struct.vy = buf.get_f32_le()?;
29122 __struct.vz = buf.get_f32_le()?;
29123 __struct.afx = buf.get_f32_le()?;
29124 __struct.afy = buf.get_f32_le()?;
29125 __struct.afz = buf.get_f32_le()?;
29126 __struct.yaw = buf.get_f32_le()?;
29127 __struct.yaw_rate = buf.get_f32_le()?;
29128 let tmp = buf.get_u16_le()?;
29129 __struct.type_mask =
29130 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
29131 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29132 flag_type: "PositionTargetTypemask",
29133 value: tmp as u64,
29134 })?;
29135 __struct.target_system = buf.get_u8()?;
29136 __struct.target_component = buf.get_u8()?;
29137 let tmp = buf.get_u8()?;
29138 __struct.coordinate_frame =
29139 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29140 enum_type: "MavFrame",
29141 value: tmp as u64,
29142 })?;
29143 Ok(__struct)
29144 }
29145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29146 let mut __tmp = BytesMut::new(bytes);
29147 #[allow(clippy::absurd_extreme_comparisons)]
29148 #[allow(unused_comparisons)]
29149 if __tmp.remaining() < Self::ENCODED_LEN {
29150 panic!(
29151 "buffer is too small (need {} bytes, but got {})",
29152 Self::ENCODED_LEN,
29153 __tmp.remaining(),
29154 )
29155 }
29156 __tmp.put_u32_le(self.time_boot_ms);
29157 __tmp.put_i32_le(self.lat_int);
29158 __tmp.put_i32_le(self.lon_int);
29159 __tmp.put_f32_le(self.alt);
29160 __tmp.put_f32_le(self.vx);
29161 __tmp.put_f32_le(self.vy);
29162 __tmp.put_f32_le(self.vz);
29163 __tmp.put_f32_le(self.afx);
29164 __tmp.put_f32_le(self.afy);
29165 __tmp.put_f32_le(self.afz);
29166 __tmp.put_f32_le(self.yaw);
29167 __tmp.put_f32_le(self.yaw_rate);
29168 __tmp.put_u16_le(self.type_mask.bits() as u16);
29169 __tmp.put_u8(self.target_system);
29170 __tmp.put_u8(self.target_component);
29171 __tmp.put_u8(self.coordinate_frame as u8);
29172 if matches!(version, MavlinkVersion::V2) {
29173 let len = __tmp.len();
29174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29175 } else {
29176 __tmp.len()
29177 }
29178 }
29179}
29180#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
29181#[doc = ""]
29182#[doc = "ID: 84"]
29183#[derive(Debug, Clone, PartialEq)]
29184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29186#[cfg_attr(feature = "ts", derive(TS))]
29187#[cfg_attr(feature = "ts", ts(export))]
29188pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
29189 #[doc = "Timestamp (time since system boot)."]
29190 pub time_boot_ms: u32,
29191 #[doc = "X Position in NED frame"]
29192 pub x: f32,
29193 #[doc = "Y Position in NED frame"]
29194 pub y: f32,
29195 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
29196 pub z: f32,
29197 #[doc = "X velocity in NED frame"]
29198 pub vx: f32,
29199 #[doc = "Y velocity in NED frame"]
29200 pub vy: f32,
29201 #[doc = "Z velocity in NED frame"]
29202 pub vz: f32,
29203 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29204 pub afx: f32,
29205 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29206 pub afy: f32,
29207 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29208 pub afz: f32,
29209 #[doc = "yaw setpoint"]
29210 pub yaw: f32,
29211 #[doc = "yaw rate setpoint"]
29212 pub yaw_rate: f32,
29213 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29214 pub type_mask: PositionTargetTypemask,
29215 #[doc = "System ID"]
29216 pub target_system: u8,
29217 #[doc = "Component ID"]
29218 pub target_component: u8,
29219 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
29220 pub coordinate_frame: MavFrame,
29221}
29222impl SET_POSITION_TARGET_LOCAL_NED_DATA {
29223 pub const ENCODED_LEN: usize = 53usize;
29224 pub const DEFAULT: Self = Self {
29225 time_boot_ms: 0_u32,
29226 x: 0.0_f32,
29227 y: 0.0_f32,
29228 z: 0.0_f32,
29229 vx: 0.0_f32,
29230 vy: 0.0_f32,
29231 vz: 0.0_f32,
29232 afx: 0.0_f32,
29233 afy: 0.0_f32,
29234 afz: 0.0_f32,
29235 yaw: 0.0_f32,
29236 yaw_rate: 0.0_f32,
29237 type_mask: PositionTargetTypemask::DEFAULT,
29238 target_system: 0_u8,
29239 target_component: 0_u8,
29240 coordinate_frame: MavFrame::DEFAULT,
29241 };
29242 #[cfg(feature = "arbitrary")]
29243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29244 use arbitrary::{Arbitrary, Unstructured};
29245 let mut buf = [0u8; 1024];
29246 rng.fill_bytes(&mut buf);
29247 let mut unstructured = Unstructured::new(&buf);
29248 Self::arbitrary(&mut unstructured).unwrap_or_default()
29249 }
29250}
29251impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
29252 fn default() -> Self {
29253 Self::DEFAULT.clone()
29254 }
29255}
29256impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
29257 type Message = MavMessage;
29258 const ID: u32 = 84u32;
29259 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
29260 const EXTRA_CRC: u8 = 143u8;
29261 const ENCODED_LEN: usize = 53usize;
29262 fn deser(
29263 _version: MavlinkVersion,
29264 __input: &[u8],
29265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29266 let avail_len = __input.len();
29267 let mut payload_buf = [0; Self::ENCODED_LEN];
29268 let mut buf = if avail_len < Self::ENCODED_LEN {
29269 payload_buf[0..avail_len].copy_from_slice(__input);
29270 Bytes::new(&payload_buf)
29271 } else {
29272 Bytes::new(__input)
29273 };
29274 let mut __struct = Self::default();
29275 __struct.time_boot_ms = buf.get_u32_le()?;
29276 __struct.x = buf.get_f32_le()?;
29277 __struct.y = buf.get_f32_le()?;
29278 __struct.z = buf.get_f32_le()?;
29279 __struct.vx = buf.get_f32_le()?;
29280 __struct.vy = buf.get_f32_le()?;
29281 __struct.vz = buf.get_f32_le()?;
29282 __struct.afx = buf.get_f32_le()?;
29283 __struct.afy = buf.get_f32_le()?;
29284 __struct.afz = buf.get_f32_le()?;
29285 __struct.yaw = buf.get_f32_le()?;
29286 __struct.yaw_rate = buf.get_f32_le()?;
29287 let tmp = buf.get_u16_le()?;
29288 __struct.type_mask =
29289 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
29290 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29291 flag_type: "PositionTargetTypemask",
29292 value: tmp as u64,
29293 })?;
29294 __struct.target_system = buf.get_u8()?;
29295 __struct.target_component = buf.get_u8()?;
29296 let tmp = buf.get_u8()?;
29297 __struct.coordinate_frame =
29298 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29299 enum_type: "MavFrame",
29300 value: tmp as u64,
29301 })?;
29302 Ok(__struct)
29303 }
29304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29305 let mut __tmp = BytesMut::new(bytes);
29306 #[allow(clippy::absurd_extreme_comparisons)]
29307 #[allow(unused_comparisons)]
29308 if __tmp.remaining() < Self::ENCODED_LEN {
29309 panic!(
29310 "buffer is too small (need {} bytes, but got {})",
29311 Self::ENCODED_LEN,
29312 __tmp.remaining(),
29313 )
29314 }
29315 __tmp.put_u32_le(self.time_boot_ms);
29316 __tmp.put_f32_le(self.x);
29317 __tmp.put_f32_le(self.y);
29318 __tmp.put_f32_le(self.z);
29319 __tmp.put_f32_le(self.vx);
29320 __tmp.put_f32_le(self.vy);
29321 __tmp.put_f32_le(self.vz);
29322 __tmp.put_f32_le(self.afx);
29323 __tmp.put_f32_le(self.afy);
29324 __tmp.put_f32_le(self.afz);
29325 __tmp.put_f32_le(self.yaw);
29326 __tmp.put_f32_le(self.yaw_rate);
29327 __tmp.put_u16_le(self.type_mask.bits() as u16);
29328 __tmp.put_u8(self.target_system);
29329 __tmp.put_u8(self.target_component);
29330 __tmp.put_u8(self.coordinate_frame as u8);
29331 if matches!(version, MavlinkVersion::V2) {
29332 let len = __tmp.len();
29333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29334 } else {
29335 __tmp.len()
29336 }
29337 }
29338}
29339#[doc = "Set temporary maximum limits for horizontal speed, vertical speed and yaw rate. The consumer must stream the current limits in VELOCITY_LIMITS at 1 Hz or more (when limits are being set). The consumer should latch the limits until a new limit is received or the mode is changed."]
29340#[doc = ""]
29341#[doc = "ID: 354"]
29342#[derive(Debug, Clone, PartialEq)]
29343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29345#[cfg_attr(feature = "ts", derive(TS))]
29346#[cfg_attr(feature = "ts", ts(export))]
29347pub struct SET_VELOCITY_LIMITS_DATA {
29348 #[doc = "Limit for horizontal movement in MAV_FRAME_LOCAL_NED. NaN: Field not used (ignore)"]
29349 pub horizontal_speed_limit: f32,
29350 #[doc = "Limit for vertical movement in MAV_FRAME_LOCAL_NED. NaN: Field not used (ignore)"]
29351 pub vertical_speed_limit: f32,
29352 #[doc = "Limit for vehicle turn rate around its yaw axis. NaN: Field not used (ignore)"]
29353 pub yaw_rate_limit: f32,
29354 #[doc = "System ID (0 for broadcast)."]
29355 pub target_system: u8,
29356 #[doc = "Component ID (0 for broadcast)."]
29357 pub target_component: u8,
29358}
29359impl SET_VELOCITY_LIMITS_DATA {
29360 pub const ENCODED_LEN: usize = 14usize;
29361 pub const DEFAULT: Self = Self {
29362 horizontal_speed_limit: 0.0_f32,
29363 vertical_speed_limit: 0.0_f32,
29364 yaw_rate_limit: 0.0_f32,
29365 target_system: 0_u8,
29366 target_component: 0_u8,
29367 };
29368 #[cfg(feature = "arbitrary")]
29369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29370 use arbitrary::{Arbitrary, Unstructured};
29371 let mut buf = [0u8; 1024];
29372 rng.fill_bytes(&mut buf);
29373 let mut unstructured = Unstructured::new(&buf);
29374 Self::arbitrary(&mut unstructured).unwrap_or_default()
29375 }
29376}
29377impl Default for SET_VELOCITY_LIMITS_DATA {
29378 fn default() -> Self {
29379 Self::DEFAULT.clone()
29380 }
29381}
29382impl MessageData for SET_VELOCITY_LIMITS_DATA {
29383 type Message = MavMessage;
29384 const ID: u32 = 354u32;
29385 const NAME: &'static str = "SET_VELOCITY_LIMITS";
29386 const EXTRA_CRC: u8 = 210u8;
29387 const ENCODED_LEN: usize = 14usize;
29388 fn deser(
29389 _version: MavlinkVersion,
29390 __input: &[u8],
29391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29392 let avail_len = __input.len();
29393 let mut payload_buf = [0; Self::ENCODED_LEN];
29394 let mut buf = if avail_len < Self::ENCODED_LEN {
29395 payload_buf[0..avail_len].copy_from_slice(__input);
29396 Bytes::new(&payload_buf)
29397 } else {
29398 Bytes::new(__input)
29399 };
29400 let mut __struct = Self::default();
29401 __struct.horizontal_speed_limit = buf.get_f32_le()?;
29402 __struct.vertical_speed_limit = buf.get_f32_le()?;
29403 __struct.yaw_rate_limit = buf.get_f32_le()?;
29404 __struct.target_system = buf.get_u8()?;
29405 __struct.target_component = buf.get_u8()?;
29406 Ok(__struct)
29407 }
29408 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29409 let mut __tmp = BytesMut::new(bytes);
29410 #[allow(clippy::absurd_extreme_comparisons)]
29411 #[allow(unused_comparisons)]
29412 if __tmp.remaining() < Self::ENCODED_LEN {
29413 panic!(
29414 "buffer is too small (need {} bytes, but got {})",
29415 Self::ENCODED_LEN,
29416 __tmp.remaining(),
29417 )
29418 }
29419 __tmp.put_f32_le(self.horizontal_speed_limit);
29420 __tmp.put_f32_le(self.vertical_speed_limit);
29421 __tmp.put_f32_le(self.yaw_rate_limit);
29422 __tmp.put_u8(self.target_system);
29423 __tmp.put_u8(self.target_component);
29424 if matches!(version, MavlinkVersion::V2) {
29425 let len = __tmp.len();
29426 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29427 } else {
29428 __tmp.len()
29429 }
29430 }
29431}
29432#[doc = "Status of simulation environment, if used."]
29433#[doc = ""]
29434#[doc = "ID: 108"]
29435#[derive(Debug, Clone, PartialEq)]
29436#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29438#[cfg_attr(feature = "ts", derive(TS))]
29439#[cfg_attr(feature = "ts", ts(export))]
29440pub struct SIM_STATE_DATA {
29441 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
29442 pub q1: f32,
29443 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
29444 pub q2: f32,
29445 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
29446 pub q3: f32,
29447 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
29448 pub q4: f32,
29449 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
29450 pub roll: f32,
29451 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
29452 pub pitch: f32,
29453 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
29454 pub yaw: f32,
29455 #[doc = "X acceleration"]
29456 pub xacc: f32,
29457 #[doc = "Y acceleration"]
29458 pub yacc: f32,
29459 #[doc = "Z acceleration"]
29460 pub zacc: f32,
29461 #[doc = "Angular speed around X axis"]
29462 pub xgyro: f32,
29463 #[doc = "Angular speed around Y axis"]
29464 pub ygyro: f32,
29465 #[doc = "Angular speed around Z axis"]
29466 pub zgyro: f32,
29467 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
29468 pub lat: f32,
29469 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
29470 pub lon: f32,
29471 #[doc = "Altitude"]
29472 pub alt: f32,
29473 #[doc = "Horizontal position standard deviation"]
29474 pub std_dev_horz: f32,
29475 #[doc = "Vertical position standard deviation"]
29476 pub std_dev_vert: f32,
29477 #[doc = "True velocity in north direction in earth-fixed NED frame"]
29478 pub vn: f32,
29479 #[doc = "True velocity in east direction in earth-fixed NED frame"]
29480 pub ve: f32,
29481 #[doc = "True velocity in down direction in earth-fixed NED frame"]
29482 pub vd: f32,
29483 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
29484 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29485 pub lat_int: i32,
29486 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
29487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29488 pub lon_int: i32,
29489}
29490impl SIM_STATE_DATA {
29491 pub const ENCODED_LEN: usize = 92usize;
29492 pub const DEFAULT: Self = Self {
29493 q1: 0.0_f32,
29494 q2: 0.0_f32,
29495 q3: 0.0_f32,
29496 q4: 0.0_f32,
29497 roll: 0.0_f32,
29498 pitch: 0.0_f32,
29499 yaw: 0.0_f32,
29500 xacc: 0.0_f32,
29501 yacc: 0.0_f32,
29502 zacc: 0.0_f32,
29503 xgyro: 0.0_f32,
29504 ygyro: 0.0_f32,
29505 zgyro: 0.0_f32,
29506 lat: 0.0_f32,
29507 lon: 0.0_f32,
29508 alt: 0.0_f32,
29509 std_dev_horz: 0.0_f32,
29510 std_dev_vert: 0.0_f32,
29511 vn: 0.0_f32,
29512 ve: 0.0_f32,
29513 vd: 0.0_f32,
29514 lat_int: 0_i32,
29515 lon_int: 0_i32,
29516 };
29517 #[cfg(feature = "arbitrary")]
29518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29519 use arbitrary::{Arbitrary, Unstructured};
29520 let mut buf = [0u8; 1024];
29521 rng.fill_bytes(&mut buf);
29522 let mut unstructured = Unstructured::new(&buf);
29523 Self::arbitrary(&mut unstructured).unwrap_or_default()
29524 }
29525}
29526impl Default for SIM_STATE_DATA {
29527 fn default() -> Self {
29528 Self::DEFAULT.clone()
29529 }
29530}
29531impl MessageData for SIM_STATE_DATA {
29532 type Message = MavMessage;
29533 const ID: u32 = 108u32;
29534 const NAME: &'static str = "SIM_STATE";
29535 const EXTRA_CRC: u8 = 32u8;
29536 const ENCODED_LEN: usize = 92usize;
29537 fn deser(
29538 _version: MavlinkVersion,
29539 __input: &[u8],
29540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29541 let avail_len = __input.len();
29542 let mut payload_buf = [0; Self::ENCODED_LEN];
29543 let mut buf = if avail_len < Self::ENCODED_LEN {
29544 payload_buf[0..avail_len].copy_from_slice(__input);
29545 Bytes::new(&payload_buf)
29546 } else {
29547 Bytes::new(__input)
29548 };
29549 let mut __struct = Self::default();
29550 __struct.q1 = buf.get_f32_le()?;
29551 __struct.q2 = buf.get_f32_le()?;
29552 __struct.q3 = buf.get_f32_le()?;
29553 __struct.q4 = buf.get_f32_le()?;
29554 __struct.roll = buf.get_f32_le()?;
29555 __struct.pitch = buf.get_f32_le()?;
29556 __struct.yaw = buf.get_f32_le()?;
29557 __struct.xacc = buf.get_f32_le()?;
29558 __struct.yacc = buf.get_f32_le()?;
29559 __struct.zacc = buf.get_f32_le()?;
29560 __struct.xgyro = buf.get_f32_le()?;
29561 __struct.ygyro = buf.get_f32_le()?;
29562 __struct.zgyro = buf.get_f32_le()?;
29563 __struct.lat = buf.get_f32_le()?;
29564 __struct.lon = buf.get_f32_le()?;
29565 __struct.alt = buf.get_f32_le()?;
29566 __struct.std_dev_horz = buf.get_f32_le()?;
29567 __struct.std_dev_vert = buf.get_f32_le()?;
29568 __struct.vn = buf.get_f32_le()?;
29569 __struct.ve = buf.get_f32_le()?;
29570 __struct.vd = buf.get_f32_le()?;
29571 __struct.lat_int = buf.get_i32_le()?;
29572 __struct.lon_int = buf.get_i32_le()?;
29573 Ok(__struct)
29574 }
29575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29576 let mut __tmp = BytesMut::new(bytes);
29577 #[allow(clippy::absurd_extreme_comparisons)]
29578 #[allow(unused_comparisons)]
29579 if __tmp.remaining() < Self::ENCODED_LEN {
29580 panic!(
29581 "buffer is too small (need {} bytes, but got {})",
29582 Self::ENCODED_LEN,
29583 __tmp.remaining(),
29584 )
29585 }
29586 __tmp.put_f32_le(self.q1);
29587 __tmp.put_f32_le(self.q2);
29588 __tmp.put_f32_le(self.q3);
29589 __tmp.put_f32_le(self.q4);
29590 __tmp.put_f32_le(self.roll);
29591 __tmp.put_f32_le(self.pitch);
29592 __tmp.put_f32_le(self.yaw);
29593 __tmp.put_f32_le(self.xacc);
29594 __tmp.put_f32_le(self.yacc);
29595 __tmp.put_f32_le(self.zacc);
29596 __tmp.put_f32_le(self.xgyro);
29597 __tmp.put_f32_le(self.ygyro);
29598 __tmp.put_f32_le(self.zgyro);
29599 __tmp.put_f32_le(self.lat);
29600 __tmp.put_f32_le(self.lon);
29601 __tmp.put_f32_le(self.alt);
29602 __tmp.put_f32_le(self.std_dev_horz);
29603 __tmp.put_f32_le(self.std_dev_vert);
29604 __tmp.put_f32_le(self.vn);
29605 __tmp.put_f32_le(self.ve);
29606 __tmp.put_f32_le(self.vd);
29607 if matches!(version, MavlinkVersion::V2) {
29608 __tmp.put_i32_le(self.lat_int);
29609 __tmp.put_i32_le(self.lon_int);
29610 let len = __tmp.len();
29611 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29612 } else {
29613 __tmp.len()
29614 }
29615 }
29616}
29617#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29618#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29619#[doc = ""]
29620#[doc = "ID: 370"]
29621#[derive(Debug, Clone, PartialEq)]
29622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29624#[cfg_attr(feature = "ts", derive(TS))]
29625#[cfg_attr(feature = "ts", ts(export))]
29626pub struct SMART_BATTERY_INFO_DATA {
29627 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29628 pub capacity_full_specification: i32,
29629 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29630 pub capacity_full: i32,
29631 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29632 pub cycle_count: u16,
29633 #[doc = "Battery weight. 0: field not provided."]
29634 pub weight: u16,
29635 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29636 pub discharge_minimum_voltage: u16,
29637 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29638 pub charging_minimum_voltage: u16,
29639 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29640 pub resting_minimum_voltage: u16,
29641 #[doc = "Battery ID"]
29642 pub id: u8,
29643 #[doc = "Function of the battery"]
29644 pub battery_function: MavBatteryFunction,
29645 #[doc = "Type (chemistry) of the battery"]
29646 pub mavtype: MavBatteryType,
29647 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29648 #[cfg_attr(feature = "ts", ts(type = "string"))]
29649 pub serial_number: CharArray<16>,
29650 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29651 #[cfg_attr(feature = "ts", ts(type = "string"))]
29652 pub device_name: CharArray<50>,
29653 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29655 pub charging_maximum_voltage: u16,
29656 #[doc = "Number of battery cells in series. 0: field not provided."]
29657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29658 pub cells_in_series: u8,
29659 #[doc = "Maximum pack discharge current. 0: field not provided."]
29660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29661 pub discharge_maximum_current: u32,
29662 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29663 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29664 pub discharge_maximum_burst_current: u32,
29665 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29666 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29667 #[cfg_attr(feature = "ts", ts(type = "string"))]
29668 pub manufacture_date: CharArray<11>,
29669}
29670impl SMART_BATTERY_INFO_DATA {
29671 pub const ENCODED_LEN: usize = 109usize;
29672 pub const DEFAULT: Self = Self {
29673 capacity_full_specification: 0_i32,
29674 capacity_full: 0_i32,
29675 cycle_count: 0_u16,
29676 weight: 0_u16,
29677 discharge_minimum_voltage: 0_u16,
29678 charging_minimum_voltage: 0_u16,
29679 resting_minimum_voltage: 0_u16,
29680 id: 0_u8,
29681 battery_function: MavBatteryFunction::DEFAULT,
29682 mavtype: MavBatteryType::DEFAULT,
29683 serial_number: CharArray::new([0_u8; 16usize]),
29684 device_name: CharArray::new([0_u8; 50usize]),
29685 charging_maximum_voltage: 0_u16,
29686 cells_in_series: 0_u8,
29687 discharge_maximum_current: 0_u32,
29688 discharge_maximum_burst_current: 0_u32,
29689 manufacture_date: CharArray::new([0_u8; 11usize]),
29690 };
29691 #[cfg(feature = "arbitrary")]
29692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29693 use arbitrary::{Arbitrary, Unstructured};
29694 let mut buf = [0u8; 1024];
29695 rng.fill_bytes(&mut buf);
29696 let mut unstructured = Unstructured::new(&buf);
29697 Self::arbitrary(&mut unstructured).unwrap_or_default()
29698 }
29699}
29700impl Default for SMART_BATTERY_INFO_DATA {
29701 fn default() -> Self {
29702 Self::DEFAULT.clone()
29703 }
29704}
29705impl MessageData for SMART_BATTERY_INFO_DATA {
29706 type Message = MavMessage;
29707 const ID: u32 = 370u32;
29708 const NAME: &'static str = "SMART_BATTERY_INFO";
29709 const EXTRA_CRC: u8 = 75u8;
29710 const ENCODED_LEN: usize = 109usize;
29711 fn deser(
29712 _version: MavlinkVersion,
29713 __input: &[u8],
29714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29715 let avail_len = __input.len();
29716 let mut payload_buf = [0; Self::ENCODED_LEN];
29717 let mut buf = if avail_len < Self::ENCODED_LEN {
29718 payload_buf[0..avail_len].copy_from_slice(__input);
29719 Bytes::new(&payload_buf)
29720 } else {
29721 Bytes::new(__input)
29722 };
29723 let mut __struct = Self::default();
29724 __struct.capacity_full_specification = buf.get_i32_le()?;
29725 __struct.capacity_full = buf.get_i32_le()?;
29726 __struct.cycle_count = buf.get_u16_le()?;
29727 __struct.weight = buf.get_u16_le()?;
29728 __struct.discharge_minimum_voltage = buf.get_u16_le()?;
29729 __struct.charging_minimum_voltage = buf.get_u16_le()?;
29730 __struct.resting_minimum_voltage = buf.get_u16_le()?;
29731 __struct.id = buf.get_u8()?;
29732 let tmp = buf.get_u8()?;
29733 __struct.battery_function =
29734 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29735 enum_type: "MavBatteryFunction",
29736 value: tmp as u64,
29737 })?;
29738 let tmp = buf.get_u8()?;
29739 __struct.mavtype =
29740 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29741 enum_type: "MavBatteryType",
29742 value: tmp as u64,
29743 })?;
29744 let mut tmp = [0_u8; 16usize];
29745 for v in &mut tmp {
29746 *v = buf.get_u8()?;
29747 }
29748 __struct.serial_number = CharArray::new(tmp);
29749 let mut tmp = [0_u8; 50usize];
29750 for v in &mut tmp {
29751 *v = buf.get_u8()?;
29752 }
29753 __struct.device_name = CharArray::new(tmp);
29754 __struct.charging_maximum_voltage = buf.get_u16_le()?;
29755 __struct.cells_in_series = buf.get_u8()?;
29756 __struct.discharge_maximum_current = buf.get_u32_le()?;
29757 __struct.discharge_maximum_burst_current = buf.get_u32_le()?;
29758 let mut tmp = [0_u8; 11usize];
29759 for v in &mut tmp {
29760 *v = buf.get_u8()?;
29761 }
29762 __struct.manufacture_date = CharArray::new(tmp);
29763 Ok(__struct)
29764 }
29765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29766 let mut __tmp = BytesMut::new(bytes);
29767 #[allow(clippy::absurd_extreme_comparisons)]
29768 #[allow(unused_comparisons)]
29769 if __tmp.remaining() < Self::ENCODED_LEN {
29770 panic!(
29771 "buffer is too small (need {} bytes, but got {})",
29772 Self::ENCODED_LEN,
29773 __tmp.remaining(),
29774 )
29775 }
29776 __tmp.put_i32_le(self.capacity_full_specification);
29777 __tmp.put_i32_le(self.capacity_full);
29778 __tmp.put_u16_le(self.cycle_count);
29779 __tmp.put_u16_le(self.weight);
29780 __tmp.put_u16_le(self.discharge_minimum_voltage);
29781 __tmp.put_u16_le(self.charging_minimum_voltage);
29782 __tmp.put_u16_le(self.resting_minimum_voltage);
29783 __tmp.put_u8(self.id);
29784 __tmp.put_u8(self.battery_function as u8);
29785 __tmp.put_u8(self.mavtype as u8);
29786 for val in &self.serial_number {
29787 __tmp.put_u8(*val);
29788 }
29789 for val in &self.device_name {
29790 __tmp.put_u8(*val);
29791 }
29792 if matches!(version, MavlinkVersion::V2) {
29793 __tmp.put_u16_le(self.charging_maximum_voltage);
29794 __tmp.put_u8(self.cells_in_series);
29795 __tmp.put_u32_le(self.discharge_maximum_current);
29796 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29797 for val in &self.manufacture_date {
29798 __tmp.put_u8(*val);
29799 }
29800 let len = __tmp.len();
29801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29802 } else {
29803 __tmp.len()
29804 }
29805 }
29806}
29807#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29808#[doc = ""]
29809#[doc = "ID: 253"]
29810#[derive(Debug, Clone, PartialEq)]
29811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29813#[cfg_attr(feature = "ts", derive(TS))]
29814#[cfg_attr(feature = "ts", ts(export))]
29815pub struct STATUSTEXT_DATA {
29816 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29817 pub severity: MavSeverity,
29818 #[doc = "Status text message, without null termination character"]
29819 #[cfg_attr(feature = "ts", ts(type = "string"))]
29820 pub text: CharArray<50>,
29821 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29823 pub id: u16,
29824 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29826 pub chunk_seq: u8,
29827}
29828impl STATUSTEXT_DATA {
29829 pub const ENCODED_LEN: usize = 54usize;
29830 pub const DEFAULT: Self = Self {
29831 severity: MavSeverity::DEFAULT,
29832 text: CharArray::new([0_u8; 50usize]),
29833 id: 0_u16,
29834 chunk_seq: 0_u8,
29835 };
29836 #[cfg(feature = "arbitrary")]
29837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29838 use arbitrary::{Arbitrary, Unstructured};
29839 let mut buf = [0u8; 1024];
29840 rng.fill_bytes(&mut buf);
29841 let mut unstructured = Unstructured::new(&buf);
29842 Self::arbitrary(&mut unstructured).unwrap_or_default()
29843 }
29844}
29845impl Default for STATUSTEXT_DATA {
29846 fn default() -> Self {
29847 Self::DEFAULT.clone()
29848 }
29849}
29850impl MessageData for STATUSTEXT_DATA {
29851 type Message = MavMessage;
29852 const ID: u32 = 253u32;
29853 const NAME: &'static str = "STATUSTEXT";
29854 const EXTRA_CRC: u8 = 83u8;
29855 const ENCODED_LEN: usize = 54usize;
29856 fn deser(
29857 _version: MavlinkVersion,
29858 __input: &[u8],
29859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29860 let avail_len = __input.len();
29861 let mut payload_buf = [0; Self::ENCODED_LEN];
29862 let mut buf = if avail_len < Self::ENCODED_LEN {
29863 payload_buf[0..avail_len].copy_from_slice(__input);
29864 Bytes::new(&payload_buf)
29865 } else {
29866 Bytes::new(__input)
29867 };
29868 let mut __struct = Self::default();
29869 let tmp = buf.get_u8()?;
29870 __struct.severity =
29871 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29872 enum_type: "MavSeverity",
29873 value: tmp as u64,
29874 })?;
29875 let mut tmp = [0_u8; 50usize];
29876 for v in &mut tmp {
29877 *v = buf.get_u8()?;
29878 }
29879 __struct.text = CharArray::new(tmp);
29880 __struct.id = buf.get_u16_le()?;
29881 __struct.chunk_seq = buf.get_u8()?;
29882 Ok(__struct)
29883 }
29884 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29885 let mut __tmp = BytesMut::new(bytes);
29886 #[allow(clippy::absurd_extreme_comparisons)]
29887 #[allow(unused_comparisons)]
29888 if __tmp.remaining() < Self::ENCODED_LEN {
29889 panic!(
29890 "buffer is too small (need {} bytes, but got {})",
29891 Self::ENCODED_LEN,
29892 __tmp.remaining(),
29893 )
29894 }
29895 __tmp.put_u8(self.severity as u8);
29896 for val in &self.text {
29897 __tmp.put_u8(*val);
29898 }
29899 if matches!(version, MavlinkVersion::V2) {
29900 __tmp.put_u16_le(self.id);
29901 __tmp.put_u8(self.chunk_seq);
29902 let len = __tmp.len();
29903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29904 } else {
29905 __tmp.len()
29906 }
29907 }
29908}
29909#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29910#[doc = ""]
29911#[doc = "ID: 261"]
29912#[derive(Debug, Clone, PartialEq)]
29913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29915#[cfg_attr(feature = "ts", derive(TS))]
29916#[cfg_attr(feature = "ts", ts(export))]
29917pub struct STORAGE_INFORMATION_DATA {
29918 #[doc = "Timestamp (time since system boot)."]
29919 pub time_boot_ms: u32,
29920 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29921 pub total_capacity: f32,
29922 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29923 pub used_capacity: f32,
29924 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29925 pub available_capacity: f32,
29926 #[doc = "Read speed."]
29927 pub read_speed: f32,
29928 #[doc = "Write speed."]
29929 pub write_speed: f32,
29930 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29931 pub storage_id: u8,
29932 #[doc = "Number of storage devices"]
29933 pub storage_count: u8,
29934 #[doc = "Status of storage"]
29935 pub status: StorageStatus,
29936 #[doc = "Type of storage"]
29937 #[cfg_attr(feature = "serde", serde(default))]
29938 pub mavtype: StorageType,
29939 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29941 #[cfg_attr(feature = "ts", ts(type = "string"))]
29942 pub name: CharArray<32>,
29943 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29944 #[cfg_attr(feature = "serde", serde(default))]
29945 pub storage_usage: StorageUsageFlag,
29946}
29947impl STORAGE_INFORMATION_DATA {
29948 pub const ENCODED_LEN: usize = 61usize;
29949 pub const DEFAULT: Self = Self {
29950 time_boot_ms: 0_u32,
29951 total_capacity: 0.0_f32,
29952 used_capacity: 0.0_f32,
29953 available_capacity: 0.0_f32,
29954 read_speed: 0.0_f32,
29955 write_speed: 0.0_f32,
29956 storage_id: 0_u8,
29957 storage_count: 0_u8,
29958 status: StorageStatus::DEFAULT,
29959 mavtype: StorageType::DEFAULT,
29960 name: CharArray::new([0_u8; 32usize]),
29961 storage_usage: StorageUsageFlag::DEFAULT,
29962 };
29963 #[cfg(feature = "arbitrary")]
29964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29965 use arbitrary::{Arbitrary, Unstructured};
29966 let mut buf = [0u8; 1024];
29967 rng.fill_bytes(&mut buf);
29968 let mut unstructured = Unstructured::new(&buf);
29969 Self::arbitrary(&mut unstructured).unwrap_or_default()
29970 }
29971}
29972impl Default for STORAGE_INFORMATION_DATA {
29973 fn default() -> Self {
29974 Self::DEFAULT.clone()
29975 }
29976}
29977impl MessageData for STORAGE_INFORMATION_DATA {
29978 type Message = MavMessage;
29979 const ID: u32 = 261u32;
29980 const NAME: &'static str = "STORAGE_INFORMATION";
29981 const EXTRA_CRC: u8 = 179u8;
29982 const ENCODED_LEN: usize = 61usize;
29983 fn deser(
29984 _version: MavlinkVersion,
29985 __input: &[u8],
29986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29987 let avail_len = __input.len();
29988 let mut payload_buf = [0; Self::ENCODED_LEN];
29989 let mut buf = if avail_len < Self::ENCODED_LEN {
29990 payload_buf[0..avail_len].copy_from_slice(__input);
29991 Bytes::new(&payload_buf)
29992 } else {
29993 Bytes::new(__input)
29994 };
29995 let mut __struct = Self::default();
29996 __struct.time_boot_ms = buf.get_u32_le()?;
29997 __struct.total_capacity = buf.get_f32_le()?;
29998 __struct.used_capacity = buf.get_f32_le()?;
29999 __struct.available_capacity = buf.get_f32_le()?;
30000 __struct.read_speed = buf.get_f32_le()?;
30001 __struct.write_speed = buf.get_f32_le()?;
30002 __struct.storage_id = buf.get_u8()?;
30003 __struct.storage_count = buf.get_u8()?;
30004 let tmp = buf.get_u8()?;
30005 __struct.status =
30006 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30007 enum_type: "StorageStatus",
30008 value: tmp as u64,
30009 })?;
30010 let tmp = buf.get_u8()?;
30011 __struct.mavtype =
30012 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30013 enum_type: "StorageType",
30014 value: tmp as u64,
30015 })?;
30016 let mut tmp = [0_u8; 32usize];
30017 for v in &mut tmp {
30018 *v = buf.get_u8()?;
30019 }
30020 __struct.name = CharArray::new(tmp);
30021 let tmp = buf.get_u8()?;
30022 __struct.storage_usage = StorageUsageFlag::from_bits(
30023 tmp as <StorageUsageFlag as Flags>::Bits,
30024 )
30025 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30026 flag_type: "StorageUsageFlag",
30027 value: tmp as u64,
30028 })?;
30029 Ok(__struct)
30030 }
30031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30032 let mut __tmp = BytesMut::new(bytes);
30033 #[allow(clippy::absurd_extreme_comparisons)]
30034 #[allow(unused_comparisons)]
30035 if __tmp.remaining() < Self::ENCODED_LEN {
30036 panic!(
30037 "buffer is too small (need {} bytes, but got {})",
30038 Self::ENCODED_LEN,
30039 __tmp.remaining(),
30040 )
30041 }
30042 __tmp.put_u32_le(self.time_boot_ms);
30043 __tmp.put_f32_le(self.total_capacity);
30044 __tmp.put_f32_le(self.used_capacity);
30045 __tmp.put_f32_le(self.available_capacity);
30046 __tmp.put_f32_le(self.read_speed);
30047 __tmp.put_f32_le(self.write_speed);
30048 __tmp.put_u8(self.storage_id);
30049 __tmp.put_u8(self.storage_count);
30050 __tmp.put_u8(self.status as u8);
30051 if matches!(version, MavlinkVersion::V2) {
30052 __tmp.put_u8(self.mavtype as u8);
30053 for val in &self.name {
30054 __tmp.put_u8(*val);
30055 }
30056 __tmp.put_u8(self.storage_usage.bits() as u8);
30057 let len = __tmp.len();
30058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30059 } else {
30060 __tmp.len()
30061 }
30062 }
30063}
30064#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
30065#[doc = ""]
30066#[doc = "ID: 401"]
30067#[derive(Debug, Clone, PartialEq)]
30068#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30070#[cfg_attr(feature = "ts", derive(TS))]
30071#[cfg_attr(feature = "ts", ts(export))]
30072pub struct SUPPORTED_TUNES_DATA {
30073 #[doc = "Bitfield of supported tune formats."]
30074 pub format: TuneFormat,
30075 #[doc = "System ID"]
30076 pub target_system: u8,
30077 #[doc = "Component ID"]
30078 pub target_component: u8,
30079}
30080impl SUPPORTED_TUNES_DATA {
30081 pub const ENCODED_LEN: usize = 6usize;
30082 pub const DEFAULT: Self = Self {
30083 format: TuneFormat::DEFAULT,
30084 target_system: 0_u8,
30085 target_component: 0_u8,
30086 };
30087 #[cfg(feature = "arbitrary")]
30088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30089 use arbitrary::{Arbitrary, Unstructured};
30090 let mut buf = [0u8; 1024];
30091 rng.fill_bytes(&mut buf);
30092 let mut unstructured = Unstructured::new(&buf);
30093 Self::arbitrary(&mut unstructured).unwrap_or_default()
30094 }
30095}
30096impl Default for SUPPORTED_TUNES_DATA {
30097 fn default() -> Self {
30098 Self::DEFAULT.clone()
30099 }
30100}
30101impl MessageData for SUPPORTED_TUNES_DATA {
30102 type Message = MavMessage;
30103 const ID: u32 = 401u32;
30104 const NAME: &'static str = "SUPPORTED_TUNES";
30105 const EXTRA_CRC: u8 = 183u8;
30106 const ENCODED_LEN: usize = 6usize;
30107 fn deser(
30108 _version: MavlinkVersion,
30109 __input: &[u8],
30110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30111 let avail_len = __input.len();
30112 let mut payload_buf = [0; Self::ENCODED_LEN];
30113 let mut buf = if avail_len < Self::ENCODED_LEN {
30114 payload_buf[0..avail_len].copy_from_slice(__input);
30115 Bytes::new(&payload_buf)
30116 } else {
30117 Bytes::new(__input)
30118 };
30119 let mut __struct = Self::default();
30120 let tmp = buf.get_u32_le()?;
30121 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
30122 ::mavlink_core::error::ParserError::InvalidEnum {
30123 enum_type: "TuneFormat",
30124 value: tmp as u64,
30125 },
30126 )?;
30127 __struct.target_system = buf.get_u8()?;
30128 __struct.target_component = buf.get_u8()?;
30129 Ok(__struct)
30130 }
30131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30132 let mut __tmp = BytesMut::new(bytes);
30133 #[allow(clippy::absurd_extreme_comparisons)]
30134 #[allow(unused_comparisons)]
30135 if __tmp.remaining() < Self::ENCODED_LEN {
30136 panic!(
30137 "buffer is too small (need {} bytes, but got {})",
30138 Self::ENCODED_LEN,
30139 __tmp.remaining(),
30140 )
30141 }
30142 __tmp.put_u32_le(self.format as u32);
30143 __tmp.put_u8(self.target_system);
30144 __tmp.put_u8(self.target_component);
30145 if matches!(version, MavlinkVersion::V2) {
30146 let len = __tmp.len();
30147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30148 } else {
30149 __tmp.len()
30150 }
30151 }
30152}
30153#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
30154#[doc = ""]
30155#[doc = "ID: 2"]
30156#[derive(Debug, Clone, PartialEq)]
30157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30159#[cfg_attr(feature = "ts", derive(TS))]
30160#[cfg_attr(feature = "ts", ts(export))]
30161pub struct SYSTEM_TIME_DATA {
30162 #[doc = "Timestamp (UNIX epoch time)."]
30163 pub time_unix_usec: u64,
30164 #[doc = "Timestamp (time since system boot)."]
30165 pub time_boot_ms: u32,
30166}
30167impl SYSTEM_TIME_DATA {
30168 pub const ENCODED_LEN: usize = 12usize;
30169 pub const DEFAULT: Self = Self {
30170 time_unix_usec: 0_u64,
30171 time_boot_ms: 0_u32,
30172 };
30173 #[cfg(feature = "arbitrary")]
30174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30175 use arbitrary::{Arbitrary, Unstructured};
30176 let mut buf = [0u8; 1024];
30177 rng.fill_bytes(&mut buf);
30178 let mut unstructured = Unstructured::new(&buf);
30179 Self::arbitrary(&mut unstructured).unwrap_or_default()
30180 }
30181}
30182impl Default for SYSTEM_TIME_DATA {
30183 fn default() -> Self {
30184 Self::DEFAULT.clone()
30185 }
30186}
30187impl MessageData for SYSTEM_TIME_DATA {
30188 type Message = MavMessage;
30189 const ID: u32 = 2u32;
30190 const NAME: &'static str = "SYSTEM_TIME";
30191 const EXTRA_CRC: u8 = 137u8;
30192 const ENCODED_LEN: usize = 12usize;
30193 fn deser(
30194 _version: MavlinkVersion,
30195 __input: &[u8],
30196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30197 let avail_len = __input.len();
30198 let mut payload_buf = [0; Self::ENCODED_LEN];
30199 let mut buf = if avail_len < Self::ENCODED_LEN {
30200 payload_buf[0..avail_len].copy_from_slice(__input);
30201 Bytes::new(&payload_buf)
30202 } else {
30203 Bytes::new(__input)
30204 };
30205 let mut __struct = Self::default();
30206 __struct.time_unix_usec = buf.get_u64_le()?;
30207 __struct.time_boot_ms = buf.get_u32_le()?;
30208 Ok(__struct)
30209 }
30210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30211 let mut __tmp = BytesMut::new(bytes);
30212 #[allow(clippy::absurd_extreme_comparisons)]
30213 #[allow(unused_comparisons)]
30214 if __tmp.remaining() < Self::ENCODED_LEN {
30215 panic!(
30216 "buffer is too small (need {} bytes, but got {})",
30217 Self::ENCODED_LEN,
30218 __tmp.remaining(),
30219 )
30220 }
30221 __tmp.put_u64_le(self.time_unix_usec);
30222 __tmp.put_u32_le(self.time_boot_ms);
30223 if matches!(version, MavlinkVersion::V2) {
30224 let len = __tmp.len();
30225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30226 } else {
30227 __tmp.len()
30228 }
30229 }
30230}
30231#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
30232#[doc = ""]
30233#[doc = "ID: 1"]
30234#[derive(Debug, Clone, PartialEq)]
30235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30237#[cfg_attr(feature = "ts", derive(TS))]
30238#[cfg_attr(feature = "ts", ts(export))]
30239pub struct SYS_STATUS_DATA {
30240 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30241 pub onboard_control_sensors_present: MavSysStatusSensor,
30242 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30243 pub onboard_control_sensors_enabled: MavSysStatusSensor,
30244 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30245 pub onboard_control_sensors_health: MavSysStatusSensor,
30246 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
30247 pub load: u16,
30248 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
30249 pub voltage_battery: u16,
30250 #[doc = "Battery current, -1: Current not sent by autopilot"]
30251 pub current_battery: i16,
30252 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30253 pub drop_rate_comm: u16,
30254 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30255 pub errors_comm: u16,
30256 #[doc = "Autopilot-specific errors"]
30257 pub errors_count1: u16,
30258 #[doc = "Autopilot-specific errors"]
30259 pub errors_count2: u16,
30260 #[doc = "Autopilot-specific errors"]
30261 pub errors_count3: u16,
30262 #[doc = "Autopilot-specific errors"]
30263 pub errors_count4: u16,
30264 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
30265 pub battery_remaining: i8,
30266 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30267 #[cfg_attr(feature = "serde", serde(default))]
30268 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
30269 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30270 #[cfg_attr(feature = "serde", serde(default))]
30271 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
30272 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30273 #[cfg_attr(feature = "serde", serde(default))]
30274 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
30275}
30276impl SYS_STATUS_DATA {
30277 pub const ENCODED_LEN: usize = 43usize;
30278 pub const DEFAULT: Self = Self {
30279 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
30280 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
30281 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
30282 load: 0_u16,
30283 voltage_battery: 0_u16,
30284 current_battery: 0_i16,
30285 drop_rate_comm: 0_u16,
30286 errors_comm: 0_u16,
30287 errors_count1: 0_u16,
30288 errors_count2: 0_u16,
30289 errors_count3: 0_u16,
30290 errors_count4: 0_u16,
30291 battery_remaining: 0_i8,
30292 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
30293 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
30294 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
30295 };
30296 #[cfg(feature = "arbitrary")]
30297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30298 use arbitrary::{Arbitrary, Unstructured};
30299 let mut buf = [0u8; 1024];
30300 rng.fill_bytes(&mut buf);
30301 let mut unstructured = Unstructured::new(&buf);
30302 Self::arbitrary(&mut unstructured).unwrap_or_default()
30303 }
30304}
30305impl Default for SYS_STATUS_DATA {
30306 fn default() -> Self {
30307 Self::DEFAULT.clone()
30308 }
30309}
30310impl MessageData for SYS_STATUS_DATA {
30311 type Message = MavMessage;
30312 const ID: u32 = 1u32;
30313 const NAME: &'static str = "SYS_STATUS";
30314 const EXTRA_CRC: u8 = 124u8;
30315 const ENCODED_LEN: usize = 43usize;
30316 fn deser(
30317 _version: MavlinkVersion,
30318 __input: &[u8],
30319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30320 let avail_len = __input.len();
30321 let mut payload_buf = [0; Self::ENCODED_LEN];
30322 let mut buf = if avail_len < Self::ENCODED_LEN {
30323 payload_buf[0..avail_len].copy_from_slice(__input);
30324 Bytes::new(&payload_buf)
30325 } else {
30326 Bytes::new(__input)
30327 };
30328 let mut __struct = Self::default();
30329 let tmp = buf.get_u32_le()?;
30330 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
30331 tmp as <MavSysStatusSensor as Flags>::Bits,
30332 )
30333 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30334 flag_type: "MavSysStatusSensor",
30335 value: tmp as u64,
30336 })?;
30337 let tmp = buf.get_u32_le()?;
30338 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
30339 tmp as <MavSysStatusSensor as Flags>::Bits,
30340 )
30341 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30342 flag_type: "MavSysStatusSensor",
30343 value: tmp as u64,
30344 })?;
30345 let tmp = buf.get_u32_le()?;
30346 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
30347 tmp as <MavSysStatusSensor as Flags>::Bits,
30348 )
30349 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30350 flag_type: "MavSysStatusSensor",
30351 value: tmp as u64,
30352 })?;
30353 __struct.load = buf.get_u16_le()?;
30354 __struct.voltage_battery = buf.get_u16_le()?;
30355 __struct.current_battery = buf.get_i16_le()?;
30356 __struct.drop_rate_comm = buf.get_u16_le()?;
30357 __struct.errors_comm = buf.get_u16_le()?;
30358 __struct.errors_count1 = buf.get_u16_le()?;
30359 __struct.errors_count2 = buf.get_u16_le()?;
30360 __struct.errors_count3 = buf.get_u16_le()?;
30361 __struct.errors_count4 = buf.get_u16_le()?;
30362 __struct.battery_remaining = buf.get_i8()?;
30363 let tmp = buf.get_u32_le()?;
30364 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
30365 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30366 )
30367 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30368 flag_type: "MavSysStatusSensorExtended",
30369 value: tmp as u64,
30370 })?;
30371 let tmp = buf.get_u32_le()?;
30372 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
30373 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30374 )
30375 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30376 flag_type: "MavSysStatusSensorExtended",
30377 value: tmp as u64,
30378 })?;
30379 let tmp = buf.get_u32_le()?;
30380 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
30381 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30382 )
30383 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30384 flag_type: "MavSysStatusSensorExtended",
30385 value: tmp as u64,
30386 })?;
30387 Ok(__struct)
30388 }
30389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30390 let mut __tmp = BytesMut::new(bytes);
30391 #[allow(clippy::absurd_extreme_comparisons)]
30392 #[allow(unused_comparisons)]
30393 if __tmp.remaining() < Self::ENCODED_LEN {
30394 panic!(
30395 "buffer is too small (need {} bytes, but got {})",
30396 Self::ENCODED_LEN,
30397 __tmp.remaining(),
30398 )
30399 }
30400 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
30401 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
30402 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
30403 __tmp.put_u16_le(self.load);
30404 __tmp.put_u16_le(self.voltage_battery);
30405 __tmp.put_i16_le(self.current_battery);
30406 __tmp.put_u16_le(self.drop_rate_comm);
30407 __tmp.put_u16_le(self.errors_comm);
30408 __tmp.put_u16_le(self.errors_count1);
30409 __tmp.put_u16_le(self.errors_count2);
30410 __tmp.put_u16_le(self.errors_count3);
30411 __tmp.put_u16_le(self.errors_count4);
30412 __tmp.put_i8(self.battery_remaining);
30413 if matches!(version, MavlinkVersion::V2) {
30414 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
30415 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
30416 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
30417 let len = __tmp.len();
30418 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30419 } else {
30420 __tmp.len()
30421 }
30422 }
30423}
30424#[doc = "Current motion information from sensors on a target."]
30425#[doc = ""]
30426#[doc = "ID: 510"]
30427#[derive(Debug, Clone, PartialEq)]
30428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30430#[cfg_attr(feature = "ts", derive(TS))]
30431#[cfg_attr(feature = "ts", ts(export))]
30432pub struct TARGET_ABSOLUTE_DATA {
30433 #[doc = "Timestamp (UNIX epoch time)."]
30434 pub timestamp: u64,
30435 #[doc = "Target's latitude (WGS84)"]
30436 pub lat: i32,
30437 #[doc = "Target's longitude (WGS84)"]
30438 pub lon: i32,
30439 #[doc = "Target's altitude (AMSL)"]
30440 pub alt: f32,
30441 #[doc = "Target's velocity in its body frame"]
30442 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30443 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30444 pub vel: [f32; 3],
30445 #[doc = "Linear target's acceleration in its body frame"]
30446 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30447 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30448 pub acc: [f32; 3],
30449 #[doc = "Quaternion of the target's orientation from its body frame to the vehicle's NED frame."]
30450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30451 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30452 pub q_target: [f32; 4],
30453 #[doc = "Target's roll, pitch and yaw rates"]
30454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30455 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30456 pub rates: [f32; 3],
30457 #[doc = "Standard deviation of horizontal (eph) and vertical (epv) position errors"]
30458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30459 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30460 pub position_std: [f32; 2],
30461 #[doc = "Standard deviation of the target's velocity in its body frame"]
30462 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30463 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30464 pub vel_std: [f32; 3],
30465 #[doc = "Standard deviation of the target's acceleration in its body frame"]
30466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30467 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30468 pub acc_std: [f32; 3],
30469 #[doc = "The ID of the target if multiple targets are present"]
30470 pub id: u8,
30471 #[doc = "Bitmap to indicate the sensor's reporting capabilities"]
30472 pub sensor_capabilities: TargetAbsoluteSensorCapabilityFlags,
30473}
30474impl TARGET_ABSOLUTE_DATA {
30475 pub const ENCODED_LEN: usize = 106usize;
30476 pub const DEFAULT: Self = Self {
30477 timestamp: 0_u64,
30478 lat: 0_i32,
30479 lon: 0_i32,
30480 alt: 0.0_f32,
30481 vel: [0.0_f32; 3usize],
30482 acc: [0.0_f32; 3usize],
30483 q_target: [0.0_f32; 4usize],
30484 rates: [0.0_f32; 3usize],
30485 position_std: [0.0_f32; 2usize],
30486 vel_std: [0.0_f32; 3usize],
30487 acc_std: [0.0_f32; 3usize],
30488 id: 0_u8,
30489 sensor_capabilities: TargetAbsoluteSensorCapabilityFlags::DEFAULT,
30490 };
30491 #[cfg(feature = "arbitrary")]
30492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30493 use arbitrary::{Arbitrary, Unstructured};
30494 let mut buf = [0u8; 1024];
30495 rng.fill_bytes(&mut buf);
30496 let mut unstructured = Unstructured::new(&buf);
30497 Self::arbitrary(&mut unstructured).unwrap_or_default()
30498 }
30499}
30500impl Default for TARGET_ABSOLUTE_DATA {
30501 fn default() -> Self {
30502 Self::DEFAULT.clone()
30503 }
30504}
30505impl MessageData for TARGET_ABSOLUTE_DATA {
30506 type Message = MavMessage;
30507 const ID: u32 = 510u32;
30508 const NAME: &'static str = "TARGET_ABSOLUTE";
30509 const EXTRA_CRC: u8 = 245u8;
30510 const ENCODED_LEN: usize = 106usize;
30511 fn deser(
30512 _version: MavlinkVersion,
30513 __input: &[u8],
30514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30515 let avail_len = __input.len();
30516 let mut payload_buf = [0; Self::ENCODED_LEN];
30517 let mut buf = if avail_len < Self::ENCODED_LEN {
30518 payload_buf[0..avail_len].copy_from_slice(__input);
30519 Bytes::new(&payload_buf)
30520 } else {
30521 Bytes::new(__input)
30522 };
30523 let mut __struct = Self::default();
30524 __struct.timestamp = buf.get_u64_le()?;
30525 __struct.lat = buf.get_i32_le()?;
30526 __struct.lon = buf.get_i32_le()?;
30527 __struct.alt = buf.get_f32_le()?;
30528 for v in &mut __struct.vel {
30529 let val = buf.get_f32_le()?;
30530 *v = val;
30531 }
30532 for v in &mut __struct.acc {
30533 let val = buf.get_f32_le()?;
30534 *v = val;
30535 }
30536 for v in &mut __struct.q_target {
30537 let val = buf.get_f32_le()?;
30538 *v = val;
30539 }
30540 for v in &mut __struct.rates {
30541 let val = buf.get_f32_le()?;
30542 *v = val;
30543 }
30544 for v in &mut __struct.position_std {
30545 let val = buf.get_f32_le()?;
30546 *v = val;
30547 }
30548 for v in &mut __struct.vel_std {
30549 let val = buf.get_f32_le()?;
30550 *v = val;
30551 }
30552 for v in &mut __struct.acc_std {
30553 let val = buf.get_f32_le()?;
30554 *v = val;
30555 }
30556 __struct.id = buf.get_u8()?;
30557 let tmp = buf.get_u8()?;
30558 __struct.sensor_capabilities = TargetAbsoluteSensorCapabilityFlags::from_bits(
30559 tmp as <TargetAbsoluteSensorCapabilityFlags as Flags>::Bits,
30560 )
30561 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30562 flag_type: "TargetAbsoluteSensorCapabilityFlags",
30563 value: tmp as u64,
30564 })?;
30565 Ok(__struct)
30566 }
30567 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30568 let mut __tmp = BytesMut::new(bytes);
30569 #[allow(clippy::absurd_extreme_comparisons)]
30570 #[allow(unused_comparisons)]
30571 if __tmp.remaining() < Self::ENCODED_LEN {
30572 panic!(
30573 "buffer is too small (need {} bytes, but got {})",
30574 Self::ENCODED_LEN,
30575 __tmp.remaining(),
30576 )
30577 }
30578 __tmp.put_u64_le(self.timestamp);
30579 __tmp.put_i32_le(self.lat);
30580 __tmp.put_i32_le(self.lon);
30581 __tmp.put_f32_le(self.alt);
30582 for val in &self.vel {
30583 __tmp.put_f32_le(*val);
30584 }
30585 for val in &self.acc {
30586 __tmp.put_f32_le(*val);
30587 }
30588 for val in &self.q_target {
30589 __tmp.put_f32_le(*val);
30590 }
30591 for val in &self.rates {
30592 __tmp.put_f32_le(*val);
30593 }
30594 for val in &self.position_std {
30595 __tmp.put_f32_le(*val);
30596 }
30597 for val in &self.vel_std {
30598 __tmp.put_f32_le(*val);
30599 }
30600 for val in &self.acc_std {
30601 __tmp.put_f32_le(*val);
30602 }
30603 __tmp.put_u8(self.id);
30604 __tmp.put_u8(self.sensor_capabilities.bits() as u8);
30605 if matches!(version, MavlinkVersion::V2) {
30606 let len = __tmp.len();
30607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30608 } else {
30609 __tmp.len()
30610 }
30611 }
30612}
30613#[doc = "The location of a target measured by MAV's onboard sensors."]
30614#[doc = ""]
30615#[doc = "ID: 511"]
30616#[derive(Debug, Clone, PartialEq)]
30617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30619#[cfg_attr(feature = "ts", derive(TS))]
30620#[cfg_attr(feature = "ts", ts(export))]
30621pub struct TARGET_RELATIVE_DATA {
30622 #[doc = "Timestamp (UNIX epoch time)"]
30623 pub timestamp: u64,
30624 #[doc = "X Position of the target in TARGET_OBS_FRAME"]
30625 pub x: f32,
30626 #[doc = "Y Position of the target in TARGET_OBS_FRAME"]
30627 pub y: f32,
30628 #[doc = "Z Position of the target in TARGET_OBS_FRAME"]
30629 pub z: f32,
30630 #[doc = "Standard deviation of the target's position in TARGET_OBS_FRAME"]
30631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30632 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30633 pub pos_std: [f32; 3],
30634 #[doc = "Standard deviation of the target's orientation in TARGET_OBS_FRAME"]
30635 pub yaw_std: f32,
30636 #[doc = "Quaternion of the target's orientation from the target's frame to the TARGET_OBS_FRAME (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
30637 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30638 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30639 pub q_target: [f32; 4],
30640 #[doc = "Quaternion of the sensor's orientation from TARGET_OBS_FRAME to vehicle-carried NED. (Ignored if set to (0,0,0,0)) (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
30641 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30642 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30643 pub q_sensor: [f32; 4],
30644 #[doc = "The ID of the target if multiple targets are present"]
30645 pub id: u8,
30646 #[doc = "Coordinate frame used for following fields."]
30647 pub frame: TargetObsFrame,
30648 #[doc = "Type of target"]
30649 pub mavtype: LandingTargetType,
30650}
30651impl TARGET_RELATIVE_DATA {
30652 pub const ENCODED_LEN: usize = 71usize;
30653 pub const DEFAULT: Self = Self {
30654 timestamp: 0_u64,
30655 x: 0.0_f32,
30656 y: 0.0_f32,
30657 z: 0.0_f32,
30658 pos_std: [0.0_f32; 3usize],
30659 yaw_std: 0.0_f32,
30660 q_target: [0.0_f32; 4usize],
30661 q_sensor: [0.0_f32; 4usize],
30662 id: 0_u8,
30663 frame: TargetObsFrame::DEFAULT,
30664 mavtype: LandingTargetType::DEFAULT,
30665 };
30666 #[cfg(feature = "arbitrary")]
30667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30668 use arbitrary::{Arbitrary, Unstructured};
30669 let mut buf = [0u8; 1024];
30670 rng.fill_bytes(&mut buf);
30671 let mut unstructured = Unstructured::new(&buf);
30672 Self::arbitrary(&mut unstructured).unwrap_or_default()
30673 }
30674}
30675impl Default for TARGET_RELATIVE_DATA {
30676 fn default() -> Self {
30677 Self::DEFAULT.clone()
30678 }
30679}
30680impl MessageData for TARGET_RELATIVE_DATA {
30681 type Message = MavMessage;
30682 const ID: u32 = 511u32;
30683 const NAME: &'static str = "TARGET_RELATIVE";
30684 const EXTRA_CRC: u8 = 28u8;
30685 const ENCODED_LEN: usize = 71usize;
30686 fn deser(
30687 _version: MavlinkVersion,
30688 __input: &[u8],
30689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30690 let avail_len = __input.len();
30691 let mut payload_buf = [0; Self::ENCODED_LEN];
30692 let mut buf = if avail_len < Self::ENCODED_LEN {
30693 payload_buf[0..avail_len].copy_from_slice(__input);
30694 Bytes::new(&payload_buf)
30695 } else {
30696 Bytes::new(__input)
30697 };
30698 let mut __struct = Self::default();
30699 __struct.timestamp = buf.get_u64_le()?;
30700 __struct.x = buf.get_f32_le()?;
30701 __struct.y = buf.get_f32_le()?;
30702 __struct.z = buf.get_f32_le()?;
30703 for v in &mut __struct.pos_std {
30704 let val = buf.get_f32_le()?;
30705 *v = val;
30706 }
30707 __struct.yaw_std = buf.get_f32_le()?;
30708 for v in &mut __struct.q_target {
30709 let val = buf.get_f32_le()?;
30710 *v = val;
30711 }
30712 for v in &mut __struct.q_sensor {
30713 let val = buf.get_f32_le()?;
30714 *v = val;
30715 }
30716 __struct.id = buf.get_u8()?;
30717 let tmp = buf.get_u8()?;
30718 __struct.frame =
30719 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30720 enum_type: "TargetObsFrame",
30721 value: tmp as u64,
30722 })?;
30723 let tmp = buf.get_u8()?;
30724 __struct.mavtype =
30725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30726 enum_type: "LandingTargetType",
30727 value: tmp as u64,
30728 })?;
30729 Ok(__struct)
30730 }
30731 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30732 let mut __tmp = BytesMut::new(bytes);
30733 #[allow(clippy::absurd_extreme_comparisons)]
30734 #[allow(unused_comparisons)]
30735 if __tmp.remaining() < Self::ENCODED_LEN {
30736 panic!(
30737 "buffer is too small (need {} bytes, but got {})",
30738 Self::ENCODED_LEN,
30739 __tmp.remaining(),
30740 )
30741 }
30742 __tmp.put_u64_le(self.timestamp);
30743 __tmp.put_f32_le(self.x);
30744 __tmp.put_f32_le(self.y);
30745 __tmp.put_f32_le(self.z);
30746 for val in &self.pos_std {
30747 __tmp.put_f32_le(*val);
30748 }
30749 __tmp.put_f32_le(self.yaw_std);
30750 for val in &self.q_target {
30751 __tmp.put_f32_le(*val);
30752 }
30753 for val in &self.q_sensor {
30754 __tmp.put_f32_le(*val);
30755 }
30756 __tmp.put_u8(self.id);
30757 __tmp.put_u8(self.frame as u8);
30758 __tmp.put_u8(self.mavtype as u8);
30759 if matches!(version, MavlinkVersion::V2) {
30760 let len = __tmp.len();
30761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30762 } else {
30763 __tmp.len()
30764 }
30765 }
30766}
30767#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
30768#[doc = ""]
30769#[doc = "ID: 135"]
30770#[derive(Debug, Clone, PartialEq)]
30771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30773#[cfg_attr(feature = "ts", derive(TS))]
30774#[cfg_attr(feature = "ts", ts(export))]
30775pub struct TERRAIN_CHECK_DATA {
30776 #[doc = "Latitude"]
30777 pub lat: i32,
30778 #[doc = "Longitude"]
30779 pub lon: i32,
30780}
30781impl TERRAIN_CHECK_DATA {
30782 pub const ENCODED_LEN: usize = 8usize;
30783 pub const DEFAULT: Self = Self {
30784 lat: 0_i32,
30785 lon: 0_i32,
30786 };
30787 #[cfg(feature = "arbitrary")]
30788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30789 use arbitrary::{Arbitrary, Unstructured};
30790 let mut buf = [0u8; 1024];
30791 rng.fill_bytes(&mut buf);
30792 let mut unstructured = Unstructured::new(&buf);
30793 Self::arbitrary(&mut unstructured).unwrap_or_default()
30794 }
30795}
30796impl Default for TERRAIN_CHECK_DATA {
30797 fn default() -> Self {
30798 Self::DEFAULT.clone()
30799 }
30800}
30801impl MessageData for TERRAIN_CHECK_DATA {
30802 type Message = MavMessage;
30803 const ID: u32 = 135u32;
30804 const NAME: &'static str = "TERRAIN_CHECK";
30805 const EXTRA_CRC: u8 = 203u8;
30806 const ENCODED_LEN: usize = 8usize;
30807 fn deser(
30808 _version: MavlinkVersion,
30809 __input: &[u8],
30810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30811 let avail_len = __input.len();
30812 let mut payload_buf = [0; Self::ENCODED_LEN];
30813 let mut buf = if avail_len < Self::ENCODED_LEN {
30814 payload_buf[0..avail_len].copy_from_slice(__input);
30815 Bytes::new(&payload_buf)
30816 } else {
30817 Bytes::new(__input)
30818 };
30819 let mut __struct = Self::default();
30820 __struct.lat = buf.get_i32_le()?;
30821 __struct.lon = buf.get_i32_le()?;
30822 Ok(__struct)
30823 }
30824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30825 let mut __tmp = BytesMut::new(bytes);
30826 #[allow(clippy::absurd_extreme_comparisons)]
30827 #[allow(unused_comparisons)]
30828 if __tmp.remaining() < Self::ENCODED_LEN {
30829 panic!(
30830 "buffer is too small (need {} bytes, but got {})",
30831 Self::ENCODED_LEN,
30832 __tmp.remaining(),
30833 )
30834 }
30835 __tmp.put_i32_le(self.lat);
30836 __tmp.put_i32_le(self.lon);
30837 if matches!(version, MavlinkVersion::V2) {
30838 let len = __tmp.len();
30839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30840 } else {
30841 __tmp.len()
30842 }
30843 }
30844}
30845#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30846#[doc = ""]
30847#[doc = "ID: 134"]
30848#[derive(Debug, Clone, PartialEq)]
30849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30851#[cfg_attr(feature = "ts", derive(TS))]
30852#[cfg_attr(feature = "ts", ts(export))]
30853pub struct TERRAIN_DATA_DATA {
30854 #[doc = "Latitude of SW corner of first grid"]
30855 pub lat: i32,
30856 #[doc = "Longitude of SW corner of first grid"]
30857 pub lon: i32,
30858 #[doc = "Grid spacing"]
30859 pub grid_spacing: u16,
30860 #[doc = "Terrain data MSL"]
30861 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30862 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30863 pub data: [i16; 16],
30864 #[doc = "bit within the terrain request mask"]
30865 pub gridbit: u8,
30866}
30867impl TERRAIN_DATA_DATA {
30868 pub const ENCODED_LEN: usize = 43usize;
30869 pub const DEFAULT: Self = Self {
30870 lat: 0_i32,
30871 lon: 0_i32,
30872 grid_spacing: 0_u16,
30873 data: [0_i16; 16usize],
30874 gridbit: 0_u8,
30875 };
30876 #[cfg(feature = "arbitrary")]
30877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30878 use arbitrary::{Arbitrary, Unstructured};
30879 let mut buf = [0u8; 1024];
30880 rng.fill_bytes(&mut buf);
30881 let mut unstructured = Unstructured::new(&buf);
30882 Self::arbitrary(&mut unstructured).unwrap_or_default()
30883 }
30884}
30885impl Default for TERRAIN_DATA_DATA {
30886 fn default() -> Self {
30887 Self::DEFAULT.clone()
30888 }
30889}
30890impl MessageData for TERRAIN_DATA_DATA {
30891 type Message = MavMessage;
30892 const ID: u32 = 134u32;
30893 const NAME: &'static str = "TERRAIN_DATA";
30894 const EXTRA_CRC: u8 = 229u8;
30895 const ENCODED_LEN: usize = 43usize;
30896 fn deser(
30897 _version: MavlinkVersion,
30898 __input: &[u8],
30899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30900 let avail_len = __input.len();
30901 let mut payload_buf = [0; Self::ENCODED_LEN];
30902 let mut buf = if avail_len < Self::ENCODED_LEN {
30903 payload_buf[0..avail_len].copy_from_slice(__input);
30904 Bytes::new(&payload_buf)
30905 } else {
30906 Bytes::new(__input)
30907 };
30908 let mut __struct = Self::default();
30909 __struct.lat = buf.get_i32_le()?;
30910 __struct.lon = buf.get_i32_le()?;
30911 __struct.grid_spacing = buf.get_u16_le()?;
30912 for v in &mut __struct.data {
30913 let val = buf.get_i16_le()?;
30914 *v = val;
30915 }
30916 __struct.gridbit = buf.get_u8()?;
30917 Ok(__struct)
30918 }
30919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30920 let mut __tmp = BytesMut::new(bytes);
30921 #[allow(clippy::absurd_extreme_comparisons)]
30922 #[allow(unused_comparisons)]
30923 if __tmp.remaining() < Self::ENCODED_LEN {
30924 panic!(
30925 "buffer is too small (need {} bytes, but got {})",
30926 Self::ENCODED_LEN,
30927 __tmp.remaining(),
30928 )
30929 }
30930 __tmp.put_i32_le(self.lat);
30931 __tmp.put_i32_le(self.lon);
30932 __tmp.put_u16_le(self.grid_spacing);
30933 for val in &self.data {
30934 __tmp.put_i16_le(*val);
30935 }
30936 __tmp.put_u8(self.gridbit);
30937 if matches!(version, MavlinkVersion::V2) {
30938 let len = __tmp.len();
30939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30940 } else {
30941 __tmp.len()
30942 }
30943 }
30944}
30945#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30946#[doc = ""]
30947#[doc = "ID: 136"]
30948#[derive(Debug, Clone, PartialEq)]
30949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30951#[cfg_attr(feature = "ts", derive(TS))]
30952#[cfg_attr(feature = "ts", ts(export))]
30953pub struct TERRAIN_REPORT_DATA {
30954 #[doc = "Latitude"]
30955 pub lat: i32,
30956 #[doc = "Longitude"]
30957 pub lon: i32,
30958 #[doc = "Terrain height MSL"]
30959 pub terrain_height: f32,
30960 #[doc = "Current vehicle height above lat/lon terrain height"]
30961 pub current_height: f32,
30962 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30963 pub spacing: u16,
30964 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30965 pub pending: u16,
30966 #[doc = "Number of 4x4 terrain blocks in memory"]
30967 pub loaded: u16,
30968}
30969impl TERRAIN_REPORT_DATA {
30970 pub const ENCODED_LEN: usize = 22usize;
30971 pub const DEFAULT: Self = Self {
30972 lat: 0_i32,
30973 lon: 0_i32,
30974 terrain_height: 0.0_f32,
30975 current_height: 0.0_f32,
30976 spacing: 0_u16,
30977 pending: 0_u16,
30978 loaded: 0_u16,
30979 };
30980 #[cfg(feature = "arbitrary")]
30981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30982 use arbitrary::{Arbitrary, Unstructured};
30983 let mut buf = [0u8; 1024];
30984 rng.fill_bytes(&mut buf);
30985 let mut unstructured = Unstructured::new(&buf);
30986 Self::arbitrary(&mut unstructured).unwrap_or_default()
30987 }
30988}
30989impl Default for TERRAIN_REPORT_DATA {
30990 fn default() -> Self {
30991 Self::DEFAULT.clone()
30992 }
30993}
30994impl MessageData for TERRAIN_REPORT_DATA {
30995 type Message = MavMessage;
30996 const ID: u32 = 136u32;
30997 const NAME: &'static str = "TERRAIN_REPORT";
30998 const EXTRA_CRC: u8 = 1u8;
30999 const ENCODED_LEN: usize = 22usize;
31000 fn deser(
31001 _version: MavlinkVersion,
31002 __input: &[u8],
31003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31004 let avail_len = __input.len();
31005 let mut payload_buf = [0; Self::ENCODED_LEN];
31006 let mut buf = if avail_len < Self::ENCODED_LEN {
31007 payload_buf[0..avail_len].copy_from_slice(__input);
31008 Bytes::new(&payload_buf)
31009 } else {
31010 Bytes::new(__input)
31011 };
31012 let mut __struct = Self::default();
31013 __struct.lat = buf.get_i32_le()?;
31014 __struct.lon = buf.get_i32_le()?;
31015 __struct.terrain_height = buf.get_f32_le()?;
31016 __struct.current_height = buf.get_f32_le()?;
31017 __struct.spacing = buf.get_u16_le()?;
31018 __struct.pending = buf.get_u16_le()?;
31019 __struct.loaded = buf.get_u16_le()?;
31020 Ok(__struct)
31021 }
31022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31023 let mut __tmp = BytesMut::new(bytes);
31024 #[allow(clippy::absurd_extreme_comparisons)]
31025 #[allow(unused_comparisons)]
31026 if __tmp.remaining() < Self::ENCODED_LEN {
31027 panic!(
31028 "buffer is too small (need {} bytes, but got {})",
31029 Self::ENCODED_LEN,
31030 __tmp.remaining(),
31031 )
31032 }
31033 __tmp.put_i32_le(self.lat);
31034 __tmp.put_i32_le(self.lon);
31035 __tmp.put_f32_le(self.terrain_height);
31036 __tmp.put_f32_le(self.current_height);
31037 __tmp.put_u16_le(self.spacing);
31038 __tmp.put_u16_le(self.pending);
31039 __tmp.put_u16_le(self.loaded);
31040 if matches!(version, MavlinkVersion::V2) {
31041 let len = __tmp.len();
31042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31043 } else {
31044 __tmp.len()
31045 }
31046 }
31047}
31048#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
31049#[doc = ""]
31050#[doc = "ID: 133"]
31051#[derive(Debug, Clone, PartialEq)]
31052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31054#[cfg_attr(feature = "ts", derive(TS))]
31055#[cfg_attr(feature = "ts", ts(export))]
31056pub struct TERRAIN_REQUEST_DATA {
31057 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
31058 pub mask: u64,
31059 #[doc = "Latitude of SW corner of first grid"]
31060 pub lat: i32,
31061 #[doc = "Longitude of SW corner of first grid"]
31062 pub lon: i32,
31063 #[doc = "Grid spacing"]
31064 pub grid_spacing: u16,
31065}
31066impl TERRAIN_REQUEST_DATA {
31067 pub const ENCODED_LEN: usize = 18usize;
31068 pub const DEFAULT: Self = Self {
31069 mask: 0_u64,
31070 lat: 0_i32,
31071 lon: 0_i32,
31072 grid_spacing: 0_u16,
31073 };
31074 #[cfg(feature = "arbitrary")]
31075 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31076 use arbitrary::{Arbitrary, Unstructured};
31077 let mut buf = [0u8; 1024];
31078 rng.fill_bytes(&mut buf);
31079 let mut unstructured = Unstructured::new(&buf);
31080 Self::arbitrary(&mut unstructured).unwrap_or_default()
31081 }
31082}
31083impl Default for TERRAIN_REQUEST_DATA {
31084 fn default() -> Self {
31085 Self::DEFAULT.clone()
31086 }
31087}
31088impl MessageData for TERRAIN_REQUEST_DATA {
31089 type Message = MavMessage;
31090 const ID: u32 = 133u32;
31091 const NAME: &'static str = "TERRAIN_REQUEST";
31092 const EXTRA_CRC: u8 = 6u8;
31093 const ENCODED_LEN: usize = 18usize;
31094 fn deser(
31095 _version: MavlinkVersion,
31096 __input: &[u8],
31097 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31098 let avail_len = __input.len();
31099 let mut payload_buf = [0; Self::ENCODED_LEN];
31100 let mut buf = if avail_len < Self::ENCODED_LEN {
31101 payload_buf[0..avail_len].copy_from_slice(__input);
31102 Bytes::new(&payload_buf)
31103 } else {
31104 Bytes::new(__input)
31105 };
31106 let mut __struct = Self::default();
31107 __struct.mask = buf.get_u64_le()?;
31108 __struct.lat = buf.get_i32_le()?;
31109 __struct.lon = buf.get_i32_le()?;
31110 __struct.grid_spacing = buf.get_u16_le()?;
31111 Ok(__struct)
31112 }
31113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31114 let mut __tmp = BytesMut::new(bytes);
31115 #[allow(clippy::absurd_extreme_comparisons)]
31116 #[allow(unused_comparisons)]
31117 if __tmp.remaining() < Self::ENCODED_LEN {
31118 panic!(
31119 "buffer is too small (need {} bytes, but got {})",
31120 Self::ENCODED_LEN,
31121 __tmp.remaining(),
31122 )
31123 }
31124 __tmp.put_u64_le(self.mask);
31125 __tmp.put_i32_le(self.lat);
31126 __tmp.put_i32_le(self.lon);
31127 __tmp.put_u16_le(self.grid_spacing);
31128 if matches!(version, MavlinkVersion::V2) {
31129 let len = __tmp.len();
31130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31131 } else {
31132 __tmp.len()
31133 }
31134 }
31135}
31136#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
31137#[doc = ""]
31138#[doc = "ID: 111"]
31139#[derive(Debug, Clone, PartialEq)]
31140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31142#[cfg_attr(feature = "ts", derive(TS))]
31143#[cfg_attr(feature = "ts", ts(export))]
31144pub struct TIMESYNC_DATA {
31145 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
31146 pub tc1: i64,
31147 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
31148 pub ts1: i64,
31149 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
31150 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31151 pub target_system: u8,
31152 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
31153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31154 pub target_component: u8,
31155}
31156impl TIMESYNC_DATA {
31157 pub const ENCODED_LEN: usize = 18usize;
31158 pub const DEFAULT: Self = Self {
31159 tc1: 0_i64,
31160 ts1: 0_i64,
31161 target_system: 0_u8,
31162 target_component: 0_u8,
31163 };
31164 #[cfg(feature = "arbitrary")]
31165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31166 use arbitrary::{Arbitrary, Unstructured};
31167 let mut buf = [0u8; 1024];
31168 rng.fill_bytes(&mut buf);
31169 let mut unstructured = Unstructured::new(&buf);
31170 Self::arbitrary(&mut unstructured).unwrap_or_default()
31171 }
31172}
31173impl Default for TIMESYNC_DATA {
31174 fn default() -> Self {
31175 Self::DEFAULT.clone()
31176 }
31177}
31178impl MessageData for TIMESYNC_DATA {
31179 type Message = MavMessage;
31180 const ID: u32 = 111u32;
31181 const NAME: &'static str = "TIMESYNC";
31182 const EXTRA_CRC: u8 = 34u8;
31183 const ENCODED_LEN: usize = 18usize;
31184 fn deser(
31185 _version: MavlinkVersion,
31186 __input: &[u8],
31187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31188 let avail_len = __input.len();
31189 let mut payload_buf = [0; Self::ENCODED_LEN];
31190 let mut buf = if avail_len < Self::ENCODED_LEN {
31191 payload_buf[0..avail_len].copy_from_slice(__input);
31192 Bytes::new(&payload_buf)
31193 } else {
31194 Bytes::new(__input)
31195 };
31196 let mut __struct = Self::default();
31197 __struct.tc1 = buf.get_i64_le()?;
31198 __struct.ts1 = buf.get_i64_le()?;
31199 __struct.target_system = buf.get_u8()?;
31200 __struct.target_component = buf.get_u8()?;
31201 Ok(__struct)
31202 }
31203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31204 let mut __tmp = BytesMut::new(bytes);
31205 #[allow(clippy::absurd_extreme_comparisons)]
31206 #[allow(unused_comparisons)]
31207 if __tmp.remaining() < Self::ENCODED_LEN {
31208 panic!(
31209 "buffer is too small (need {} bytes, but got {})",
31210 Self::ENCODED_LEN,
31211 __tmp.remaining(),
31212 )
31213 }
31214 __tmp.put_i64_le(self.tc1);
31215 __tmp.put_i64_le(self.ts1);
31216 if matches!(version, MavlinkVersion::V2) {
31217 __tmp.put_u8(self.target_system);
31218 __tmp.put_u8(self.target_component);
31219 let len = __tmp.len();
31220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31221 } else {
31222 __tmp.len()
31223 }
31224 }
31225}
31226#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
31227#[doc = ""]
31228#[doc = "ID: 380"]
31229#[derive(Debug, Clone, PartialEq)]
31230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31232#[cfg_attr(feature = "ts", derive(TS))]
31233#[cfg_attr(feature = "ts", ts(export))]
31234pub struct TIME_ESTIMATE_TO_TARGET_DATA {
31235 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
31236 pub safe_return: i32,
31237 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
31238 pub land: i32,
31239 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
31240 pub mission_next_item: i32,
31241 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
31242 pub mission_end: i32,
31243 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
31244 pub commanded_action: i32,
31245}
31246impl TIME_ESTIMATE_TO_TARGET_DATA {
31247 pub const ENCODED_LEN: usize = 20usize;
31248 pub const DEFAULT: Self = Self {
31249 safe_return: 0_i32,
31250 land: 0_i32,
31251 mission_next_item: 0_i32,
31252 mission_end: 0_i32,
31253 commanded_action: 0_i32,
31254 };
31255 #[cfg(feature = "arbitrary")]
31256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31257 use arbitrary::{Arbitrary, Unstructured};
31258 let mut buf = [0u8; 1024];
31259 rng.fill_bytes(&mut buf);
31260 let mut unstructured = Unstructured::new(&buf);
31261 Self::arbitrary(&mut unstructured).unwrap_or_default()
31262 }
31263}
31264impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
31265 fn default() -> Self {
31266 Self::DEFAULT.clone()
31267 }
31268}
31269impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
31270 type Message = MavMessage;
31271 const ID: u32 = 380u32;
31272 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
31273 const EXTRA_CRC: u8 = 232u8;
31274 const ENCODED_LEN: usize = 20usize;
31275 fn deser(
31276 _version: MavlinkVersion,
31277 __input: &[u8],
31278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31279 let avail_len = __input.len();
31280 let mut payload_buf = [0; Self::ENCODED_LEN];
31281 let mut buf = if avail_len < Self::ENCODED_LEN {
31282 payload_buf[0..avail_len].copy_from_slice(__input);
31283 Bytes::new(&payload_buf)
31284 } else {
31285 Bytes::new(__input)
31286 };
31287 let mut __struct = Self::default();
31288 __struct.safe_return = buf.get_i32_le()?;
31289 __struct.land = buf.get_i32_le()?;
31290 __struct.mission_next_item = buf.get_i32_le()?;
31291 __struct.mission_end = buf.get_i32_le()?;
31292 __struct.commanded_action = buf.get_i32_le()?;
31293 Ok(__struct)
31294 }
31295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31296 let mut __tmp = BytesMut::new(bytes);
31297 #[allow(clippy::absurd_extreme_comparisons)]
31298 #[allow(unused_comparisons)]
31299 if __tmp.remaining() < Self::ENCODED_LEN {
31300 panic!(
31301 "buffer is too small (need {} bytes, but got {})",
31302 Self::ENCODED_LEN,
31303 __tmp.remaining(),
31304 )
31305 }
31306 __tmp.put_i32_le(self.safe_return);
31307 __tmp.put_i32_le(self.land);
31308 __tmp.put_i32_le(self.mission_next_item);
31309 __tmp.put_i32_le(self.mission_end);
31310 __tmp.put_i32_le(self.commanded_action);
31311 if matches!(version, MavlinkVersion::V2) {
31312 let len = __tmp.len();
31313 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31314 } else {
31315 __tmp.len()
31316 }
31317 }
31318}
31319#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
31320#[doc = ""]
31321#[doc = "ID: 333"]
31322#[derive(Debug, Clone, PartialEq)]
31323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31325#[cfg_attr(feature = "ts", derive(TS))]
31326#[cfg_attr(feature = "ts", ts(export))]
31327pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31328 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31329 pub time_usec: u64,
31330 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
31331 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31332 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31333 pub pos_x: [f32; 5],
31334 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
31335 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31336 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31337 pub pos_y: [f32; 5],
31338 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
31339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31340 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31341 pub pos_z: [f32; 5],
31342 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
31343 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31344 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31345 pub delta: [f32; 5],
31346 #[doc = "Yaw. Set to NaN for unchanged"]
31347 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31348 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31349 pub pos_yaw: [f32; 5],
31350 #[doc = "Number of valid control points (up-to 5 points are possible)"]
31351 pub valid_points: u8,
31352}
31353impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31354 pub const ENCODED_LEN: usize = 109usize;
31355 pub const DEFAULT: Self = Self {
31356 time_usec: 0_u64,
31357 pos_x: [0.0_f32; 5usize],
31358 pos_y: [0.0_f32; 5usize],
31359 pos_z: [0.0_f32; 5usize],
31360 delta: [0.0_f32; 5usize],
31361 pos_yaw: [0.0_f32; 5usize],
31362 valid_points: 0_u8,
31363 };
31364 #[cfg(feature = "arbitrary")]
31365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31366 use arbitrary::{Arbitrary, Unstructured};
31367 let mut buf = [0u8; 1024];
31368 rng.fill_bytes(&mut buf);
31369 let mut unstructured = Unstructured::new(&buf);
31370 Self::arbitrary(&mut unstructured).unwrap_or_default()
31371 }
31372}
31373impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31374 fn default() -> Self {
31375 Self::DEFAULT.clone()
31376 }
31377}
31378impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31379 type Message = MavMessage;
31380 const ID: u32 = 333u32;
31381 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
31382 const EXTRA_CRC: u8 = 231u8;
31383 const ENCODED_LEN: usize = 109usize;
31384 fn deser(
31385 _version: MavlinkVersion,
31386 __input: &[u8],
31387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31388 let avail_len = __input.len();
31389 let mut payload_buf = [0; Self::ENCODED_LEN];
31390 let mut buf = if avail_len < Self::ENCODED_LEN {
31391 payload_buf[0..avail_len].copy_from_slice(__input);
31392 Bytes::new(&payload_buf)
31393 } else {
31394 Bytes::new(__input)
31395 };
31396 let mut __struct = Self::default();
31397 __struct.time_usec = buf.get_u64_le()?;
31398 for v in &mut __struct.pos_x {
31399 let val = buf.get_f32_le()?;
31400 *v = val;
31401 }
31402 for v in &mut __struct.pos_y {
31403 let val = buf.get_f32_le()?;
31404 *v = val;
31405 }
31406 for v in &mut __struct.pos_z {
31407 let val = buf.get_f32_le()?;
31408 *v = val;
31409 }
31410 for v in &mut __struct.delta {
31411 let val = buf.get_f32_le()?;
31412 *v = val;
31413 }
31414 for v in &mut __struct.pos_yaw {
31415 let val = buf.get_f32_le()?;
31416 *v = val;
31417 }
31418 __struct.valid_points = buf.get_u8()?;
31419 Ok(__struct)
31420 }
31421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31422 let mut __tmp = BytesMut::new(bytes);
31423 #[allow(clippy::absurd_extreme_comparisons)]
31424 #[allow(unused_comparisons)]
31425 if __tmp.remaining() < Self::ENCODED_LEN {
31426 panic!(
31427 "buffer is too small (need {} bytes, but got {})",
31428 Self::ENCODED_LEN,
31429 __tmp.remaining(),
31430 )
31431 }
31432 __tmp.put_u64_le(self.time_usec);
31433 for val in &self.pos_x {
31434 __tmp.put_f32_le(*val);
31435 }
31436 for val in &self.pos_y {
31437 __tmp.put_f32_le(*val);
31438 }
31439 for val in &self.pos_z {
31440 __tmp.put_f32_le(*val);
31441 }
31442 for val in &self.delta {
31443 __tmp.put_f32_le(*val);
31444 }
31445 for val in &self.pos_yaw {
31446 __tmp.put_f32_le(*val);
31447 }
31448 __tmp.put_u8(self.valid_points);
31449 if matches!(version, MavlinkVersion::V2) {
31450 let len = __tmp.len();
31451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31452 } else {
31453 __tmp.len()
31454 }
31455 }
31456}
31457#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
31458#[doc = ""]
31459#[doc = "ID: 332"]
31460#[derive(Debug, Clone, PartialEq)]
31461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31463#[cfg_attr(feature = "ts", derive(TS))]
31464#[cfg_attr(feature = "ts", ts(export))]
31465pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31467 pub time_usec: u64,
31468 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
31469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31471 pub pos_x: [f32; 5],
31472 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
31473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31474 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31475 pub pos_y: [f32; 5],
31476 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
31477 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31478 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31479 pub pos_z: [f32; 5],
31480 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
31481 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31482 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31483 pub vel_x: [f32; 5],
31484 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
31485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31486 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31487 pub vel_y: [f32; 5],
31488 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
31489 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31490 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31491 pub vel_z: [f32; 5],
31492 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
31493 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31494 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31495 pub acc_x: [f32; 5],
31496 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
31497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31498 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31499 pub acc_y: [f32; 5],
31500 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
31501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31502 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31503 pub acc_z: [f32; 5],
31504 #[doc = "Yaw angle, set to NaN if not being used"]
31505 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31506 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31507 pub pos_yaw: [f32; 5],
31508 #[doc = "Yaw rate, set to NaN if not being used"]
31509 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31510 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31511 pub vel_yaw: [f32; 5],
31512 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
31513 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31514 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31515 pub command: [u16; 5],
31516 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
31517 pub valid_points: u8,
31518}
31519impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31520 pub const ENCODED_LEN: usize = 239usize;
31521 pub const DEFAULT: Self = Self {
31522 time_usec: 0_u64,
31523 pos_x: [0.0_f32; 5usize],
31524 pos_y: [0.0_f32; 5usize],
31525 pos_z: [0.0_f32; 5usize],
31526 vel_x: [0.0_f32; 5usize],
31527 vel_y: [0.0_f32; 5usize],
31528 vel_z: [0.0_f32; 5usize],
31529 acc_x: [0.0_f32; 5usize],
31530 acc_y: [0.0_f32; 5usize],
31531 acc_z: [0.0_f32; 5usize],
31532 pos_yaw: [0.0_f32; 5usize],
31533 vel_yaw: [0.0_f32; 5usize],
31534 command: [0_u16; 5usize],
31535 valid_points: 0_u8,
31536 };
31537 #[cfg(feature = "arbitrary")]
31538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31539 use arbitrary::{Arbitrary, Unstructured};
31540 let mut buf = [0u8; 1024];
31541 rng.fill_bytes(&mut buf);
31542 let mut unstructured = Unstructured::new(&buf);
31543 Self::arbitrary(&mut unstructured).unwrap_or_default()
31544 }
31545}
31546impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31547 fn default() -> Self {
31548 Self::DEFAULT.clone()
31549 }
31550}
31551impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31552 type Message = MavMessage;
31553 const ID: u32 = 332u32;
31554 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
31555 const EXTRA_CRC: u8 = 236u8;
31556 const ENCODED_LEN: usize = 239usize;
31557 fn deser(
31558 _version: MavlinkVersion,
31559 __input: &[u8],
31560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31561 let avail_len = __input.len();
31562 let mut payload_buf = [0; Self::ENCODED_LEN];
31563 let mut buf = if avail_len < Self::ENCODED_LEN {
31564 payload_buf[0..avail_len].copy_from_slice(__input);
31565 Bytes::new(&payload_buf)
31566 } else {
31567 Bytes::new(__input)
31568 };
31569 let mut __struct = Self::default();
31570 __struct.time_usec = buf.get_u64_le()?;
31571 for v in &mut __struct.pos_x {
31572 let val = buf.get_f32_le()?;
31573 *v = val;
31574 }
31575 for v in &mut __struct.pos_y {
31576 let val = buf.get_f32_le()?;
31577 *v = val;
31578 }
31579 for v in &mut __struct.pos_z {
31580 let val = buf.get_f32_le()?;
31581 *v = val;
31582 }
31583 for v in &mut __struct.vel_x {
31584 let val = buf.get_f32_le()?;
31585 *v = val;
31586 }
31587 for v in &mut __struct.vel_y {
31588 let val = buf.get_f32_le()?;
31589 *v = val;
31590 }
31591 for v in &mut __struct.vel_z {
31592 let val = buf.get_f32_le()?;
31593 *v = val;
31594 }
31595 for v in &mut __struct.acc_x {
31596 let val = buf.get_f32_le()?;
31597 *v = val;
31598 }
31599 for v in &mut __struct.acc_y {
31600 let val = buf.get_f32_le()?;
31601 *v = val;
31602 }
31603 for v in &mut __struct.acc_z {
31604 let val = buf.get_f32_le()?;
31605 *v = val;
31606 }
31607 for v in &mut __struct.pos_yaw {
31608 let val = buf.get_f32_le()?;
31609 *v = val;
31610 }
31611 for v in &mut __struct.vel_yaw {
31612 let val = buf.get_f32_le()?;
31613 *v = val;
31614 }
31615 for v in &mut __struct.command {
31616 let val = buf.get_u16_le()?;
31617 *v = val;
31618 }
31619 __struct.valid_points = buf.get_u8()?;
31620 Ok(__struct)
31621 }
31622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31623 let mut __tmp = BytesMut::new(bytes);
31624 #[allow(clippy::absurd_extreme_comparisons)]
31625 #[allow(unused_comparisons)]
31626 if __tmp.remaining() < Self::ENCODED_LEN {
31627 panic!(
31628 "buffer is too small (need {} bytes, but got {})",
31629 Self::ENCODED_LEN,
31630 __tmp.remaining(),
31631 )
31632 }
31633 __tmp.put_u64_le(self.time_usec);
31634 for val in &self.pos_x {
31635 __tmp.put_f32_le(*val);
31636 }
31637 for val in &self.pos_y {
31638 __tmp.put_f32_le(*val);
31639 }
31640 for val in &self.pos_z {
31641 __tmp.put_f32_le(*val);
31642 }
31643 for val in &self.vel_x {
31644 __tmp.put_f32_le(*val);
31645 }
31646 for val in &self.vel_y {
31647 __tmp.put_f32_le(*val);
31648 }
31649 for val in &self.vel_z {
31650 __tmp.put_f32_le(*val);
31651 }
31652 for val in &self.acc_x {
31653 __tmp.put_f32_le(*val);
31654 }
31655 for val in &self.acc_y {
31656 __tmp.put_f32_le(*val);
31657 }
31658 for val in &self.acc_z {
31659 __tmp.put_f32_le(*val);
31660 }
31661 for val in &self.pos_yaw {
31662 __tmp.put_f32_le(*val);
31663 }
31664 for val in &self.vel_yaw {
31665 __tmp.put_f32_le(*val);
31666 }
31667 for val in &self.command {
31668 __tmp.put_u16_le(*val);
31669 }
31670 __tmp.put_u8(self.valid_points);
31671 if matches!(version, MavlinkVersion::V2) {
31672 let len = __tmp.len();
31673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31674 } else {
31675 __tmp.len()
31676 }
31677 }
31678}
31679#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
31680#[doc = ""]
31681#[doc = "ID: 385"]
31682#[derive(Debug, Clone, PartialEq)]
31683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31685#[cfg_attr(feature = "ts", derive(TS))]
31686#[cfg_attr(feature = "ts", ts(export))]
31687pub struct TUNNEL_DATA {
31688 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31689 pub payload_type: MavTunnelPayloadType,
31690 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
31691 pub target_system: u8,
31692 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
31693 pub target_component: u8,
31694 #[doc = "Length of the data transported in payload"]
31695 pub payload_length: u8,
31696 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
31697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31698 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31699 pub payload: [u8; 128],
31700}
31701impl TUNNEL_DATA {
31702 pub const ENCODED_LEN: usize = 133usize;
31703 pub const DEFAULT: Self = Self {
31704 payload_type: MavTunnelPayloadType::DEFAULT,
31705 target_system: 0_u8,
31706 target_component: 0_u8,
31707 payload_length: 0_u8,
31708 payload: [0_u8; 128usize],
31709 };
31710 #[cfg(feature = "arbitrary")]
31711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31712 use arbitrary::{Arbitrary, Unstructured};
31713 let mut buf = [0u8; 1024];
31714 rng.fill_bytes(&mut buf);
31715 let mut unstructured = Unstructured::new(&buf);
31716 Self::arbitrary(&mut unstructured).unwrap_or_default()
31717 }
31718}
31719impl Default for TUNNEL_DATA {
31720 fn default() -> Self {
31721 Self::DEFAULT.clone()
31722 }
31723}
31724impl MessageData for TUNNEL_DATA {
31725 type Message = MavMessage;
31726 const ID: u32 = 385u32;
31727 const NAME: &'static str = "TUNNEL";
31728 const EXTRA_CRC: u8 = 147u8;
31729 const ENCODED_LEN: usize = 133usize;
31730 fn deser(
31731 _version: MavlinkVersion,
31732 __input: &[u8],
31733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31734 let avail_len = __input.len();
31735 let mut payload_buf = [0; Self::ENCODED_LEN];
31736 let mut buf = if avail_len < Self::ENCODED_LEN {
31737 payload_buf[0..avail_len].copy_from_slice(__input);
31738 Bytes::new(&payload_buf)
31739 } else {
31740 Bytes::new(__input)
31741 };
31742 let mut __struct = Self::default();
31743 let tmp = buf.get_u16_le()?;
31744 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
31745 ::mavlink_core::error::ParserError::InvalidEnum {
31746 enum_type: "MavTunnelPayloadType",
31747 value: tmp as u64,
31748 },
31749 )?;
31750 __struct.target_system = buf.get_u8()?;
31751 __struct.target_component = buf.get_u8()?;
31752 __struct.payload_length = buf.get_u8()?;
31753 for v in &mut __struct.payload {
31754 let val = buf.get_u8()?;
31755 *v = val;
31756 }
31757 Ok(__struct)
31758 }
31759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31760 let mut __tmp = BytesMut::new(bytes);
31761 #[allow(clippy::absurd_extreme_comparisons)]
31762 #[allow(unused_comparisons)]
31763 if __tmp.remaining() < Self::ENCODED_LEN {
31764 panic!(
31765 "buffer is too small (need {} bytes, but got {})",
31766 Self::ENCODED_LEN,
31767 __tmp.remaining(),
31768 )
31769 }
31770 __tmp.put_u16_le(self.payload_type as u16);
31771 __tmp.put_u8(self.target_system);
31772 __tmp.put_u8(self.target_component);
31773 __tmp.put_u8(self.payload_length);
31774 for val in &self.payload {
31775 __tmp.put_u8(*val);
31776 }
31777 if matches!(version, MavlinkVersion::V2) {
31778 let len = __tmp.len();
31779 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31780 } else {
31781 __tmp.len()
31782 }
31783 }
31784}
31785#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31786#[doc = ""]
31787#[doc = "ID: 311"]
31788#[derive(Debug, Clone, PartialEq)]
31789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31791#[cfg_attr(feature = "ts", derive(TS))]
31792#[cfg_attr(feature = "ts", ts(export))]
31793pub struct UAVCAN_NODE_INFO_DATA {
31794 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31795 pub time_usec: u64,
31796 #[doc = "Time since the start-up of the node."]
31797 pub uptime_sec: u32,
31798 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31799 pub sw_vcs_commit: u32,
31800 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31801 #[cfg_attr(feature = "ts", ts(type = "string"))]
31802 pub name: CharArray<80>,
31803 #[doc = "Hardware major version number."]
31804 pub hw_version_major: u8,
31805 #[doc = "Hardware minor version number."]
31806 pub hw_version_minor: u8,
31807 #[doc = "Hardware unique 128-bit ID."]
31808 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31809 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31810 pub hw_unique_id: [u8; 16],
31811 #[doc = "Software major version number."]
31812 pub sw_version_major: u8,
31813 #[doc = "Software minor version number."]
31814 pub sw_version_minor: u8,
31815}
31816impl UAVCAN_NODE_INFO_DATA {
31817 pub const ENCODED_LEN: usize = 116usize;
31818 pub const DEFAULT: Self = Self {
31819 time_usec: 0_u64,
31820 uptime_sec: 0_u32,
31821 sw_vcs_commit: 0_u32,
31822 name: CharArray::new([0_u8; 80usize]),
31823 hw_version_major: 0_u8,
31824 hw_version_minor: 0_u8,
31825 hw_unique_id: [0_u8; 16usize],
31826 sw_version_major: 0_u8,
31827 sw_version_minor: 0_u8,
31828 };
31829 #[cfg(feature = "arbitrary")]
31830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31831 use arbitrary::{Arbitrary, Unstructured};
31832 let mut buf = [0u8; 1024];
31833 rng.fill_bytes(&mut buf);
31834 let mut unstructured = Unstructured::new(&buf);
31835 Self::arbitrary(&mut unstructured).unwrap_or_default()
31836 }
31837}
31838impl Default for UAVCAN_NODE_INFO_DATA {
31839 fn default() -> Self {
31840 Self::DEFAULT.clone()
31841 }
31842}
31843impl MessageData for UAVCAN_NODE_INFO_DATA {
31844 type Message = MavMessage;
31845 const ID: u32 = 311u32;
31846 const NAME: &'static str = "UAVCAN_NODE_INFO";
31847 const EXTRA_CRC: u8 = 95u8;
31848 const ENCODED_LEN: usize = 116usize;
31849 fn deser(
31850 _version: MavlinkVersion,
31851 __input: &[u8],
31852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31853 let avail_len = __input.len();
31854 let mut payload_buf = [0; Self::ENCODED_LEN];
31855 let mut buf = if avail_len < Self::ENCODED_LEN {
31856 payload_buf[0..avail_len].copy_from_slice(__input);
31857 Bytes::new(&payload_buf)
31858 } else {
31859 Bytes::new(__input)
31860 };
31861 let mut __struct = Self::default();
31862 __struct.time_usec = buf.get_u64_le()?;
31863 __struct.uptime_sec = buf.get_u32_le()?;
31864 __struct.sw_vcs_commit = buf.get_u32_le()?;
31865 let mut tmp = [0_u8; 80usize];
31866 for v in &mut tmp {
31867 *v = buf.get_u8()?;
31868 }
31869 __struct.name = CharArray::new(tmp);
31870 __struct.hw_version_major = buf.get_u8()?;
31871 __struct.hw_version_minor = buf.get_u8()?;
31872 for v in &mut __struct.hw_unique_id {
31873 let val = buf.get_u8()?;
31874 *v = val;
31875 }
31876 __struct.sw_version_major = buf.get_u8()?;
31877 __struct.sw_version_minor = buf.get_u8()?;
31878 Ok(__struct)
31879 }
31880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31881 let mut __tmp = BytesMut::new(bytes);
31882 #[allow(clippy::absurd_extreme_comparisons)]
31883 #[allow(unused_comparisons)]
31884 if __tmp.remaining() < Self::ENCODED_LEN {
31885 panic!(
31886 "buffer is too small (need {} bytes, but got {})",
31887 Self::ENCODED_LEN,
31888 __tmp.remaining(),
31889 )
31890 }
31891 __tmp.put_u64_le(self.time_usec);
31892 __tmp.put_u32_le(self.uptime_sec);
31893 __tmp.put_u32_le(self.sw_vcs_commit);
31894 for val in &self.name {
31895 __tmp.put_u8(*val);
31896 }
31897 __tmp.put_u8(self.hw_version_major);
31898 __tmp.put_u8(self.hw_version_minor);
31899 for val in &self.hw_unique_id {
31900 __tmp.put_u8(*val);
31901 }
31902 __tmp.put_u8(self.sw_version_major);
31903 __tmp.put_u8(self.sw_version_minor);
31904 if matches!(version, MavlinkVersion::V2) {
31905 let len = __tmp.len();
31906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31907 } else {
31908 __tmp.len()
31909 }
31910 }
31911}
31912#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31913#[doc = ""]
31914#[doc = "ID: 310"]
31915#[derive(Debug, Clone, PartialEq)]
31916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31918#[cfg_attr(feature = "ts", derive(TS))]
31919#[cfg_attr(feature = "ts", ts(export))]
31920pub struct UAVCAN_NODE_STATUS_DATA {
31921 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31922 pub time_usec: u64,
31923 #[doc = "Time since the start-up of the node."]
31924 pub uptime_sec: u32,
31925 #[doc = "Vendor-specific status information."]
31926 pub vendor_specific_status_code: u16,
31927 #[doc = "Generalized node health status."]
31928 pub health: UavcanNodeHealth,
31929 #[doc = "Generalized operating mode."]
31930 pub mode: UavcanNodeMode,
31931 #[doc = "Not used currently."]
31932 pub sub_mode: u8,
31933}
31934impl UAVCAN_NODE_STATUS_DATA {
31935 pub const ENCODED_LEN: usize = 17usize;
31936 pub const DEFAULT: Self = Self {
31937 time_usec: 0_u64,
31938 uptime_sec: 0_u32,
31939 vendor_specific_status_code: 0_u16,
31940 health: UavcanNodeHealth::DEFAULT,
31941 mode: UavcanNodeMode::DEFAULT,
31942 sub_mode: 0_u8,
31943 };
31944 #[cfg(feature = "arbitrary")]
31945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31946 use arbitrary::{Arbitrary, Unstructured};
31947 let mut buf = [0u8; 1024];
31948 rng.fill_bytes(&mut buf);
31949 let mut unstructured = Unstructured::new(&buf);
31950 Self::arbitrary(&mut unstructured).unwrap_or_default()
31951 }
31952}
31953impl Default for UAVCAN_NODE_STATUS_DATA {
31954 fn default() -> Self {
31955 Self::DEFAULT.clone()
31956 }
31957}
31958impl MessageData for UAVCAN_NODE_STATUS_DATA {
31959 type Message = MavMessage;
31960 const ID: u32 = 310u32;
31961 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31962 const EXTRA_CRC: u8 = 28u8;
31963 const ENCODED_LEN: usize = 17usize;
31964 fn deser(
31965 _version: MavlinkVersion,
31966 __input: &[u8],
31967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31968 let avail_len = __input.len();
31969 let mut payload_buf = [0; Self::ENCODED_LEN];
31970 let mut buf = if avail_len < Self::ENCODED_LEN {
31971 payload_buf[0..avail_len].copy_from_slice(__input);
31972 Bytes::new(&payload_buf)
31973 } else {
31974 Bytes::new(__input)
31975 };
31976 let mut __struct = Self::default();
31977 __struct.time_usec = buf.get_u64_le()?;
31978 __struct.uptime_sec = buf.get_u32_le()?;
31979 __struct.vendor_specific_status_code = buf.get_u16_le()?;
31980 let tmp = buf.get_u8()?;
31981 __struct.health =
31982 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31983 enum_type: "UavcanNodeHealth",
31984 value: tmp as u64,
31985 })?;
31986 let tmp = buf.get_u8()?;
31987 __struct.mode =
31988 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31989 enum_type: "UavcanNodeMode",
31990 value: tmp as u64,
31991 })?;
31992 __struct.sub_mode = buf.get_u8()?;
31993 Ok(__struct)
31994 }
31995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31996 let mut __tmp = BytesMut::new(bytes);
31997 #[allow(clippy::absurd_extreme_comparisons)]
31998 #[allow(unused_comparisons)]
31999 if __tmp.remaining() < Self::ENCODED_LEN {
32000 panic!(
32001 "buffer is too small (need {} bytes, but got {})",
32002 Self::ENCODED_LEN,
32003 __tmp.remaining(),
32004 )
32005 }
32006 __tmp.put_u64_le(self.time_usec);
32007 __tmp.put_u32_le(self.uptime_sec);
32008 __tmp.put_u16_le(self.vendor_specific_status_code);
32009 __tmp.put_u8(self.health as u8);
32010 __tmp.put_u8(self.mode as u8);
32011 __tmp.put_u8(self.sub_mode);
32012 if matches!(version, MavlinkVersion::V2) {
32013 let len = __tmp.len();
32014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32015 } else {
32016 __tmp.len()
32017 }
32018 }
32019}
32020#[doc = "The global position resulting from GPS and sensor fusion."]
32021#[doc = ""]
32022#[doc = "ID: 340"]
32023#[derive(Debug, Clone, PartialEq)]
32024#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32025#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32026#[cfg_attr(feature = "ts", derive(TS))]
32027#[cfg_attr(feature = "ts", ts(export))]
32028pub struct UTM_GLOBAL_POSITION_DATA {
32029 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
32030 pub time: u64,
32031 #[doc = "Latitude (WGS84)"]
32032 pub lat: i32,
32033 #[doc = "Longitude (WGS84)"]
32034 pub lon: i32,
32035 #[doc = "Altitude (WGS84)"]
32036 pub alt: i32,
32037 #[doc = "Altitude above ground"]
32038 pub relative_alt: i32,
32039 #[doc = "Next waypoint, latitude (WGS84)"]
32040 pub next_lat: i32,
32041 #[doc = "Next waypoint, longitude (WGS84)"]
32042 pub next_lon: i32,
32043 #[doc = "Next waypoint, altitude (WGS84)"]
32044 pub next_alt: i32,
32045 #[doc = "Ground X speed (latitude, positive north)"]
32046 pub vx: i16,
32047 #[doc = "Ground Y speed (longitude, positive east)"]
32048 pub vy: i16,
32049 #[doc = "Ground Z speed (altitude, positive down)"]
32050 pub vz: i16,
32051 #[doc = "Horizontal position uncertainty (standard deviation)"]
32052 pub h_acc: u16,
32053 #[doc = "Altitude uncertainty (standard deviation)"]
32054 pub v_acc: u16,
32055 #[doc = "Speed uncertainty (standard deviation)"]
32056 pub vel_acc: u16,
32057 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
32058 pub update_rate: u16,
32059 #[doc = "Unique UAS ID."]
32060 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32061 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32062 pub uas_id: [u8; 18],
32063 #[doc = "Flight state"]
32064 pub flight_state: UtmFlightState,
32065 #[doc = "Bitwise OR combination of the data available flags."]
32066 pub flags: UtmDataAvailFlags,
32067}
32068impl UTM_GLOBAL_POSITION_DATA {
32069 pub const ENCODED_LEN: usize = 70usize;
32070 pub const DEFAULT: Self = Self {
32071 time: 0_u64,
32072 lat: 0_i32,
32073 lon: 0_i32,
32074 alt: 0_i32,
32075 relative_alt: 0_i32,
32076 next_lat: 0_i32,
32077 next_lon: 0_i32,
32078 next_alt: 0_i32,
32079 vx: 0_i16,
32080 vy: 0_i16,
32081 vz: 0_i16,
32082 h_acc: 0_u16,
32083 v_acc: 0_u16,
32084 vel_acc: 0_u16,
32085 update_rate: 0_u16,
32086 uas_id: [0_u8; 18usize],
32087 flight_state: UtmFlightState::DEFAULT,
32088 flags: UtmDataAvailFlags::DEFAULT,
32089 };
32090 #[cfg(feature = "arbitrary")]
32091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32092 use arbitrary::{Arbitrary, Unstructured};
32093 let mut buf = [0u8; 1024];
32094 rng.fill_bytes(&mut buf);
32095 let mut unstructured = Unstructured::new(&buf);
32096 Self::arbitrary(&mut unstructured).unwrap_or_default()
32097 }
32098}
32099impl Default for UTM_GLOBAL_POSITION_DATA {
32100 fn default() -> Self {
32101 Self::DEFAULT.clone()
32102 }
32103}
32104impl MessageData for UTM_GLOBAL_POSITION_DATA {
32105 type Message = MavMessage;
32106 const ID: u32 = 340u32;
32107 const NAME: &'static str = "UTM_GLOBAL_POSITION";
32108 const EXTRA_CRC: u8 = 99u8;
32109 const ENCODED_LEN: usize = 70usize;
32110 fn deser(
32111 _version: MavlinkVersion,
32112 __input: &[u8],
32113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32114 let avail_len = __input.len();
32115 let mut payload_buf = [0; Self::ENCODED_LEN];
32116 let mut buf = if avail_len < Self::ENCODED_LEN {
32117 payload_buf[0..avail_len].copy_from_slice(__input);
32118 Bytes::new(&payload_buf)
32119 } else {
32120 Bytes::new(__input)
32121 };
32122 let mut __struct = Self::default();
32123 __struct.time = buf.get_u64_le()?;
32124 __struct.lat = buf.get_i32_le()?;
32125 __struct.lon = buf.get_i32_le()?;
32126 __struct.alt = buf.get_i32_le()?;
32127 __struct.relative_alt = buf.get_i32_le()?;
32128 __struct.next_lat = buf.get_i32_le()?;
32129 __struct.next_lon = buf.get_i32_le()?;
32130 __struct.next_alt = buf.get_i32_le()?;
32131 __struct.vx = buf.get_i16_le()?;
32132 __struct.vy = buf.get_i16_le()?;
32133 __struct.vz = buf.get_i16_le()?;
32134 __struct.h_acc = buf.get_u16_le()?;
32135 __struct.v_acc = buf.get_u16_le()?;
32136 __struct.vel_acc = buf.get_u16_le()?;
32137 __struct.update_rate = buf.get_u16_le()?;
32138 for v in &mut __struct.uas_id {
32139 let val = buf.get_u8()?;
32140 *v = val;
32141 }
32142 let tmp = buf.get_u8()?;
32143 __struct.flight_state =
32144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32145 enum_type: "UtmFlightState",
32146 value: tmp as u64,
32147 })?;
32148 let tmp = buf.get_u8()?;
32149 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
32150 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32151 flag_type: "UtmDataAvailFlags",
32152 value: tmp as u64,
32153 })?;
32154 Ok(__struct)
32155 }
32156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32157 let mut __tmp = BytesMut::new(bytes);
32158 #[allow(clippy::absurd_extreme_comparisons)]
32159 #[allow(unused_comparisons)]
32160 if __tmp.remaining() < Self::ENCODED_LEN {
32161 panic!(
32162 "buffer is too small (need {} bytes, but got {})",
32163 Self::ENCODED_LEN,
32164 __tmp.remaining(),
32165 )
32166 }
32167 __tmp.put_u64_le(self.time);
32168 __tmp.put_i32_le(self.lat);
32169 __tmp.put_i32_le(self.lon);
32170 __tmp.put_i32_le(self.alt);
32171 __tmp.put_i32_le(self.relative_alt);
32172 __tmp.put_i32_le(self.next_lat);
32173 __tmp.put_i32_le(self.next_lon);
32174 __tmp.put_i32_le(self.next_alt);
32175 __tmp.put_i16_le(self.vx);
32176 __tmp.put_i16_le(self.vy);
32177 __tmp.put_i16_le(self.vz);
32178 __tmp.put_u16_le(self.h_acc);
32179 __tmp.put_u16_le(self.v_acc);
32180 __tmp.put_u16_le(self.vel_acc);
32181 __tmp.put_u16_le(self.update_rate);
32182 for val in &self.uas_id {
32183 __tmp.put_u8(*val);
32184 }
32185 __tmp.put_u8(self.flight_state as u8);
32186 __tmp.put_u8(self.flags.bits() as u8);
32187 if matches!(version, MavlinkVersion::V2) {
32188 let len = __tmp.len();
32189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32190 } else {
32191 __tmp.len()
32192 }
32193 }
32194}
32195#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32196#[doc = ""]
32197#[doc = "ID: 248"]
32198#[derive(Debug, Clone, PartialEq)]
32199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32201#[cfg_attr(feature = "ts", derive(TS))]
32202#[cfg_attr(feature = "ts", ts(export))]
32203pub struct V2_EXTENSION_DATA {
32204 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
32205 pub message_type: u16,
32206 #[doc = "Network ID (0 for broadcast)"]
32207 pub target_network: u8,
32208 #[doc = "System ID (0 for broadcast)"]
32209 pub target_system: u8,
32210 #[doc = "Component ID (0 for broadcast)"]
32211 pub target_component: u8,
32212 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
32213 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32214 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32215 pub payload: [u8; 249],
32216}
32217impl V2_EXTENSION_DATA {
32218 pub const ENCODED_LEN: usize = 254usize;
32219 pub const DEFAULT: Self = Self {
32220 message_type: 0_u16,
32221 target_network: 0_u8,
32222 target_system: 0_u8,
32223 target_component: 0_u8,
32224 payload: [0_u8; 249usize],
32225 };
32226 #[cfg(feature = "arbitrary")]
32227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32228 use arbitrary::{Arbitrary, Unstructured};
32229 let mut buf = [0u8; 1024];
32230 rng.fill_bytes(&mut buf);
32231 let mut unstructured = Unstructured::new(&buf);
32232 Self::arbitrary(&mut unstructured).unwrap_or_default()
32233 }
32234}
32235impl Default for V2_EXTENSION_DATA {
32236 fn default() -> Self {
32237 Self::DEFAULT.clone()
32238 }
32239}
32240impl MessageData for V2_EXTENSION_DATA {
32241 type Message = MavMessage;
32242 const ID: u32 = 248u32;
32243 const NAME: &'static str = "V2_EXTENSION";
32244 const EXTRA_CRC: u8 = 8u8;
32245 const ENCODED_LEN: usize = 254usize;
32246 fn deser(
32247 _version: MavlinkVersion,
32248 __input: &[u8],
32249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32250 let avail_len = __input.len();
32251 let mut payload_buf = [0; Self::ENCODED_LEN];
32252 let mut buf = if avail_len < Self::ENCODED_LEN {
32253 payload_buf[0..avail_len].copy_from_slice(__input);
32254 Bytes::new(&payload_buf)
32255 } else {
32256 Bytes::new(__input)
32257 };
32258 let mut __struct = Self::default();
32259 __struct.message_type = buf.get_u16_le()?;
32260 __struct.target_network = buf.get_u8()?;
32261 __struct.target_system = buf.get_u8()?;
32262 __struct.target_component = buf.get_u8()?;
32263 for v in &mut __struct.payload {
32264 let val = buf.get_u8()?;
32265 *v = val;
32266 }
32267 Ok(__struct)
32268 }
32269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32270 let mut __tmp = BytesMut::new(bytes);
32271 #[allow(clippy::absurd_extreme_comparisons)]
32272 #[allow(unused_comparisons)]
32273 if __tmp.remaining() < Self::ENCODED_LEN {
32274 panic!(
32275 "buffer is too small (need {} bytes, but got {})",
32276 Self::ENCODED_LEN,
32277 __tmp.remaining(),
32278 )
32279 }
32280 __tmp.put_u16_le(self.message_type);
32281 __tmp.put_u8(self.target_network);
32282 __tmp.put_u8(self.target_system);
32283 __tmp.put_u8(self.target_component);
32284 for val in &self.payload {
32285 __tmp.put_u8(*val);
32286 }
32287 if matches!(version, MavlinkVersion::V2) {
32288 let len = __tmp.len();
32289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32290 } else {
32291 __tmp.len()
32292 }
32293 }
32294}
32295#[doc = "Current limits for horizontal speed, vertical speed and yaw rate, as set by SET_VELOCITY_LIMITS."]
32296#[doc = ""]
32297#[doc = "ID: 355"]
32298#[derive(Debug, Clone, PartialEq)]
32299#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32300#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32301#[cfg_attr(feature = "ts", derive(TS))]
32302#[cfg_attr(feature = "ts", ts(export))]
32303pub struct VELOCITY_LIMITS_DATA {
32304 #[doc = "Limit for horizontal movement in MAV_FRAME_LOCAL_NED. NaN: No limit applied"]
32305 pub horizontal_speed_limit: f32,
32306 #[doc = "Limit for vertical movement in MAV_FRAME_LOCAL_NED. NaN: No limit applied"]
32307 pub vertical_speed_limit: f32,
32308 #[doc = "Limit for vehicle turn rate around its yaw axis. NaN: No limit applied"]
32309 pub yaw_rate_limit: f32,
32310}
32311impl VELOCITY_LIMITS_DATA {
32312 pub const ENCODED_LEN: usize = 12usize;
32313 pub const DEFAULT: Self = Self {
32314 horizontal_speed_limit: 0.0_f32,
32315 vertical_speed_limit: 0.0_f32,
32316 yaw_rate_limit: 0.0_f32,
32317 };
32318 #[cfg(feature = "arbitrary")]
32319 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32320 use arbitrary::{Arbitrary, Unstructured};
32321 let mut buf = [0u8; 1024];
32322 rng.fill_bytes(&mut buf);
32323 let mut unstructured = Unstructured::new(&buf);
32324 Self::arbitrary(&mut unstructured).unwrap_or_default()
32325 }
32326}
32327impl Default for VELOCITY_LIMITS_DATA {
32328 fn default() -> Self {
32329 Self::DEFAULT.clone()
32330 }
32331}
32332impl MessageData for VELOCITY_LIMITS_DATA {
32333 type Message = MavMessage;
32334 const ID: u32 = 355u32;
32335 const NAME: &'static str = "VELOCITY_LIMITS";
32336 const EXTRA_CRC: u8 = 6u8;
32337 const ENCODED_LEN: usize = 12usize;
32338 fn deser(
32339 _version: MavlinkVersion,
32340 __input: &[u8],
32341 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32342 let avail_len = __input.len();
32343 let mut payload_buf = [0; Self::ENCODED_LEN];
32344 let mut buf = if avail_len < Self::ENCODED_LEN {
32345 payload_buf[0..avail_len].copy_from_slice(__input);
32346 Bytes::new(&payload_buf)
32347 } else {
32348 Bytes::new(__input)
32349 };
32350 let mut __struct = Self::default();
32351 __struct.horizontal_speed_limit = buf.get_f32_le()?;
32352 __struct.vertical_speed_limit = buf.get_f32_le()?;
32353 __struct.yaw_rate_limit = buf.get_f32_le()?;
32354 Ok(__struct)
32355 }
32356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32357 let mut __tmp = BytesMut::new(bytes);
32358 #[allow(clippy::absurd_extreme_comparisons)]
32359 #[allow(unused_comparisons)]
32360 if __tmp.remaining() < Self::ENCODED_LEN {
32361 panic!(
32362 "buffer is too small (need {} bytes, but got {})",
32363 Self::ENCODED_LEN,
32364 __tmp.remaining(),
32365 )
32366 }
32367 __tmp.put_f32_le(self.horizontal_speed_limit);
32368 __tmp.put_f32_le(self.vertical_speed_limit);
32369 __tmp.put_f32_le(self.yaw_rate_limit);
32370 if matches!(version, MavlinkVersion::V2) {
32371 let len = __tmp.len();
32372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32373 } else {
32374 __tmp.len()
32375 }
32376 }
32377}
32378#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32379#[doc = ""]
32380#[doc = "ID: 74"]
32381#[derive(Debug, Clone, PartialEq)]
32382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32384#[cfg_attr(feature = "ts", derive(TS))]
32385#[cfg_attr(feature = "ts", ts(export))]
32386pub struct VFR_HUD_DATA {
32387 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
32388 pub airspeed: f32,
32389 #[doc = "Current ground speed."]
32390 pub groundspeed: f32,
32391 #[doc = "Current altitude (MSL)."]
32392 pub alt: f32,
32393 #[doc = "Current climb rate."]
32394 pub climb: f32,
32395 #[doc = "Current heading in compass units (0-360, 0=north)."]
32396 pub heading: i16,
32397 #[doc = "Current throttle setting (0 to 100)."]
32398 pub throttle: u16,
32399}
32400impl VFR_HUD_DATA {
32401 pub const ENCODED_LEN: usize = 20usize;
32402 pub const DEFAULT: Self = Self {
32403 airspeed: 0.0_f32,
32404 groundspeed: 0.0_f32,
32405 alt: 0.0_f32,
32406 climb: 0.0_f32,
32407 heading: 0_i16,
32408 throttle: 0_u16,
32409 };
32410 #[cfg(feature = "arbitrary")]
32411 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32412 use arbitrary::{Arbitrary, Unstructured};
32413 let mut buf = [0u8; 1024];
32414 rng.fill_bytes(&mut buf);
32415 let mut unstructured = Unstructured::new(&buf);
32416 Self::arbitrary(&mut unstructured).unwrap_or_default()
32417 }
32418}
32419impl Default for VFR_HUD_DATA {
32420 fn default() -> Self {
32421 Self::DEFAULT.clone()
32422 }
32423}
32424impl MessageData for VFR_HUD_DATA {
32425 type Message = MavMessage;
32426 const ID: u32 = 74u32;
32427 const NAME: &'static str = "VFR_HUD";
32428 const EXTRA_CRC: u8 = 20u8;
32429 const ENCODED_LEN: usize = 20usize;
32430 fn deser(
32431 _version: MavlinkVersion,
32432 __input: &[u8],
32433 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32434 let avail_len = __input.len();
32435 let mut payload_buf = [0; Self::ENCODED_LEN];
32436 let mut buf = if avail_len < Self::ENCODED_LEN {
32437 payload_buf[0..avail_len].copy_from_slice(__input);
32438 Bytes::new(&payload_buf)
32439 } else {
32440 Bytes::new(__input)
32441 };
32442 let mut __struct = Self::default();
32443 __struct.airspeed = buf.get_f32_le()?;
32444 __struct.groundspeed = buf.get_f32_le()?;
32445 __struct.alt = buf.get_f32_le()?;
32446 __struct.climb = buf.get_f32_le()?;
32447 __struct.heading = buf.get_i16_le()?;
32448 __struct.throttle = buf.get_u16_le()?;
32449 Ok(__struct)
32450 }
32451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32452 let mut __tmp = BytesMut::new(bytes);
32453 #[allow(clippy::absurd_extreme_comparisons)]
32454 #[allow(unused_comparisons)]
32455 if __tmp.remaining() < Self::ENCODED_LEN {
32456 panic!(
32457 "buffer is too small (need {} bytes, but got {})",
32458 Self::ENCODED_LEN,
32459 __tmp.remaining(),
32460 )
32461 }
32462 __tmp.put_f32_le(self.airspeed);
32463 __tmp.put_f32_le(self.groundspeed);
32464 __tmp.put_f32_le(self.alt);
32465 __tmp.put_f32_le(self.climb);
32466 __tmp.put_i16_le(self.heading);
32467 __tmp.put_u16_le(self.throttle);
32468 if matches!(version, MavlinkVersion::V2) {
32469 let len = __tmp.len();
32470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32471 } else {
32472 __tmp.len()
32473 }
32474 }
32475}
32476#[doc = "Vibration levels and accelerometer clipping."]
32477#[doc = ""]
32478#[doc = "ID: 241"]
32479#[derive(Debug, Clone, PartialEq)]
32480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32482#[cfg_attr(feature = "ts", derive(TS))]
32483#[cfg_attr(feature = "ts", ts(export))]
32484pub struct VIBRATION_DATA {
32485 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32486 pub time_usec: u64,
32487 #[doc = "Vibration levels on X-axis"]
32488 pub vibration_x: f32,
32489 #[doc = "Vibration levels on Y-axis"]
32490 pub vibration_y: f32,
32491 #[doc = "Vibration levels on Z-axis"]
32492 pub vibration_z: f32,
32493 #[doc = "first accelerometer clipping count"]
32494 pub clipping_0: u32,
32495 #[doc = "second accelerometer clipping count"]
32496 pub clipping_1: u32,
32497 #[doc = "third accelerometer clipping count"]
32498 pub clipping_2: u32,
32499}
32500impl VIBRATION_DATA {
32501 pub const ENCODED_LEN: usize = 32usize;
32502 pub const DEFAULT: Self = Self {
32503 time_usec: 0_u64,
32504 vibration_x: 0.0_f32,
32505 vibration_y: 0.0_f32,
32506 vibration_z: 0.0_f32,
32507 clipping_0: 0_u32,
32508 clipping_1: 0_u32,
32509 clipping_2: 0_u32,
32510 };
32511 #[cfg(feature = "arbitrary")]
32512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32513 use arbitrary::{Arbitrary, Unstructured};
32514 let mut buf = [0u8; 1024];
32515 rng.fill_bytes(&mut buf);
32516 let mut unstructured = Unstructured::new(&buf);
32517 Self::arbitrary(&mut unstructured).unwrap_or_default()
32518 }
32519}
32520impl Default for VIBRATION_DATA {
32521 fn default() -> Self {
32522 Self::DEFAULT.clone()
32523 }
32524}
32525impl MessageData for VIBRATION_DATA {
32526 type Message = MavMessage;
32527 const ID: u32 = 241u32;
32528 const NAME: &'static str = "VIBRATION";
32529 const EXTRA_CRC: u8 = 90u8;
32530 const ENCODED_LEN: usize = 32usize;
32531 fn deser(
32532 _version: MavlinkVersion,
32533 __input: &[u8],
32534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32535 let avail_len = __input.len();
32536 let mut payload_buf = [0; Self::ENCODED_LEN];
32537 let mut buf = if avail_len < Self::ENCODED_LEN {
32538 payload_buf[0..avail_len].copy_from_slice(__input);
32539 Bytes::new(&payload_buf)
32540 } else {
32541 Bytes::new(__input)
32542 };
32543 let mut __struct = Self::default();
32544 __struct.time_usec = buf.get_u64_le()?;
32545 __struct.vibration_x = buf.get_f32_le()?;
32546 __struct.vibration_y = buf.get_f32_le()?;
32547 __struct.vibration_z = buf.get_f32_le()?;
32548 __struct.clipping_0 = buf.get_u32_le()?;
32549 __struct.clipping_1 = buf.get_u32_le()?;
32550 __struct.clipping_2 = buf.get_u32_le()?;
32551 Ok(__struct)
32552 }
32553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32554 let mut __tmp = BytesMut::new(bytes);
32555 #[allow(clippy::absurd_extreme_comparisons)]
32556 #[allow(unused_comparisons)]
32557 if __tmp.remaining() < Self::ENCODED_LEN {
32558 panic!(
32559 "buffer is too small (need {} bytes, but got {})",
32560 Self::ENCODED_LEN,
32561 __tmp.remaining(),
32562 )
32563 }
32564 __tmp.put_u64_le(self.time_usec);
32565 __tmp.put_f32_le(self.vibration_x);
32566 __tmp.put_f32_le(self.vibration_y);
32567 __tmp.put_f32_le(self.vibration_z);
32568 __tmp.put_u32_le(self.clipping_0);
32569 __tmp.put_u32_le(self.clipping_1);
32570 __tmp.put_u32_le(self.clipping_2);
32571 if matches!(version, MavlinkVersion::V2) {
32572 let len = __tmp.len();
32573 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32574 } else {
32575 __tmp.len()
32576 }
32577 }
32578}
32579#[doc = "Global position estimate from a Vicon motion system source."]
32580#[doc = ""]
32581#[doc = "ID: 104"]
32582#[derive(Debug, Clone, PartialEq)]
32583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32585#[cfg_attr(feature = "ts", derive(TS))]
32586#[cfg_attr(feature = "ts", ts(export))]
32587pub struct VICON_POSITION_ESTIMATE_DATA {
32588 #[doc = "Timestamp (UNIX time or time since system boot)"]
32589 pub usec: u64,
32590 #[doc = "Global X position"]
32591 pub x: f32,
32592 #[doc = "Global Y position"]
32593 pub y: f32,
32594 #[doc = "Global Z position"]
32595 pub z: f32,
32596 #[doc = "Roll angle"]
32597 pub roll: f32,
32598 #[doc = "Pitch angle"]
32599 pub pitch: f32,
32600 #[doc = "Yaw angle"]
32601 pub yaw: f32,
32602 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32603 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32605 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32606 pub covariance: [f32; 21],
32607}
32608impl VICON_POSITION_ESTIMATE_DATA {
32609 pub const ENCODED_LEN: usize = 116usize;
32610 pub const DEFAULT: Self = Self {
32611 usec: 0_u64,
32612 x: 0.0_f32,
32613 y: 0.0_f32,
32614 z: 0.0_f32,
32615 roll: 0.0_f32,
32616 pitch: 0.0_f32,
32617 yaw: 0.0_f32,
32618 covariance: [0.0_f32; 21usize],
32619 };
32620 #[cfg(feature = "arbitrary")]
32621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32622 use arbitrary::{Arbitrary, Unstructured};
32623 let mut buf = [0u8; 1024];
32624 rng.fill_bytes(&mut buf);
32625 let mut unstructured = Unstructured::new(&buf);
32626 Self::arbitrary(&mut unstructured).unwrap_or_default()
32627 }
32628}
32629impl Default for VICON_POSITION_ESTIMATE_DATA {
32630 fn default() -> Self {
32631 Self::DEFAULT.clone()
32632 }
32633}
32634impl MessageData for VICON_POSITION_ESTIMATE_DATA {
32635 type Message = MavMessage;
32636 const ID: u32 = 104u32;
32637 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
32638 const EXTRA_CRC: u8 = 56u8;
32639 const ENCODED_LEN: usize = 116usize;
32640 fn deser(
32641 _version: MavlinkVersion,
32642 __input: &[u8],
32643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32644 let avail_len = __input.len();
32645 let mut payload_buf = [0; Self::ENCODED_LEN];
32646 let mut buf = if avail_len < Self::ENCODED_LEN {
32647 payload_buf[0..avail_len].copy_from_slice(__input);
32648 Bytes::new(&payload_buf)
32649 } else {
32650 Bytes::new(__input)
32651 };
32652 let mut __struct = Self::default();
32653 __struct.usec = buf.get_u64_le()?;
32654 __struct.x = buf.get_f32_le()?;
32655 __struct.y = buf.get_f32_le()?;
32656 __struct.z = buf.get_f32_le()?;
32657 __struct.roll = buf.get_f32_le()?;
32658 __struct.pitch = buf.get_f32_le()?;
32659 __struct.yaw = buf.get_f32_le()?;
32660 for v in &mut __struct.covariance {
32661 let val = buf.get_f32_le()?;
32662 *v = val;
32663 }
32664 Ok(__struct)
32665 }
32666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32667 let mut __tmp = BytesMut::new(bytes);
32668 #[allow(clippy::absurd_extreme_comparisons)]
32669 #[allow(unused_comparisons)]
32670 if __tmp.remaining() < Self::ENCODED_LEN {
32671 panic!(
32672 "buffer is too small (need {} bytes, but got {})",
32673 Self::ENCODED_LEN,
32674 __tmp.remaining(),
32675 )
32676 }
32677 __tmp.put_u64_le(self.usec);
32678 __tmp.put_f32_le(self.x);
32679 __tmp.put_f32_le(self.y);
32680 __tmp.put_f32_le(self.z);
32681 __tmp.put_f32_le(self.roll);
32682 __tmp.put_f32_le(self.pitch);
32683 __tmp.put_f32_le(self.yaw);
32684 if matches!(version, MavlinkVersion::V2) {
32685 for val in &self.covariance {
32686 __tmp.put_f32_le(*val);
32687 }
32688 let len = __tmp.len();
32689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32690 } else {
32691 __tmp.len()
32692 }
32693 }
32694}
32695#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32696#[doc = ""]
32697#[doc = "ID: 269"]
32698#[derive(Debug, Clone, PartialEq)]
32699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32701#[cfg_attr(feature = "ts", derive(TS))]
32702#[cfg_attr(feature = "ts", ts(export))]
32703pub struct VIDEO_STREAM_INFORMATION_DATA {
32704 #[doc = "Frame rate."]
32705 pub framerate: f32,
32706 #[doc = "Bit rate."]
32707 pub bitrate: u32,
32708 #[doc = "Bitmap of stream status flags."]
32709 pub flags: VideoStreamStatusFlags,
32710 #[doc = "Horizontal resolution."]
32711 pub resolution_h: u16,
32712 #[doc = "Vertical resolution."]
32713 pub resolution_v: u16,
32714 #[doc = "Video image rotation clockwise."]
32715 pub rotation: u16,
32716 #[doc = "Horizontal Field of view."]
32717 pub hfov: u16,
32718 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32719 pub stream_id: u8,
32720 #[doc = "Number of streams available."]
32721 pub count: u8,
32722 #[doc = "Type of stream."]
32723 pub mavtype: VideoStreamType,
32724 #[doc = "Stream name."]
32725 #[cfg_attr(feature = "ts", ts(type = "string"))]
32726 pub name: CharArray<32>,
32727 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
32728 #[cfg_attr(feature = "ts", ts(type = "string"))]
32729 pub uri: CharArray<160>,
32730 #[doc = "Encoding of stream."]
32731 #[cfg_attr(feature = "serde", serde(default))]
32732 pub encoding: VideoStreamEncoding,
32733 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32734 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32735 pub camera_device_id: u8,
32736}
32737impl VIDEO_STREAM_INFORMATION_DATA {
32738 pub const ENCODED_LEN: usize = 215usize;
32739 pub const DEFAULT: Self = Self {
32740 framerate: 0.0_f32,
32741 bitrate: 0_u32,
32742 flags: VideoStreamStatusFlags::DEFAULT,
32743 resolution_h: 0_u16,
32744 resolution_v: 0_u16,
32745 rotation: 0_u16,
32746 hfov: 0_u16,
32747 stream_id: 0_u8,
32748 count: 0_u8,
32749 mavtype: VideoStreamType::DEFAULT,
32750 name: CharArray::new([0_u8; 32usize]),
32751 uri: CharArray::new([0_u8; 160usize]),
32752 encoding: VideoStreamEncoding::DEFAULT,
32753 camera_device_id: 0_u8,
32754 };
32755 #[cfg(feature = "arbitrary")]
32756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32757 use arbitrary::{Arbitrary, Unstructured};
32758 let mut buf = [0u8; 1024];
32759 rng.fill_bytes(&mut buf);
32760 let mut unstructured = Unstructured::new(&buf);
32761 Self::arbitrary(&mut unstructured).unwrap_or_default()
32762 }
32763}
32764impl Default for VIDEO_STREAM_INFORMATION_DATA {
32765 fn default() -> Self {
32766 Self::DEFAULT.clone()
32767 }
32768}
32769impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
32770 type Message = MavMessage;
32771 const ID: u32 = 269u32;
32772 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
32773 const EXTRA_CRC: u8 = 109u8;
32774 const ENCODED_LEN: usize = 215usize;
32775 fn deser(
32776 _version: MavlinkVersion,
32777 __input: &[u8],
32778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32779 let avail_len = __input.len();
32780 let mut payload_buf = [0; Self::ENCODED_LEN];
32781 let mut buf = if avail_len < Self::ENCODED_LEN {
32782 payload_buf[0..avail_len].copy_from_slice(__input);
32783 Bytes::new(&payload_buf)
32784 } else {
32785 Bytes::new(__input)
32786 };
32787 let mut __struct = Self::default();
32788 __struct.framerate = buf.get_f32_le()?;
32789 __struct.bitrate = buf.get_u32_le()?;
32790 let tmp = buf.get_u16_le()?;
32791 __struct.flags =
32792 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32793 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32794 flag_type: "VideoStreamStatusFlags",
32795 value: tmp as u64,
32796 })?;
32797 __struct.resolution_h = buf.get_u16_le()?;
32798 __struct.resolution_v = buf.get_u16_le()?;
32799 __struct.rotation = buf.get_u16_le()?;
32800 __struct.hfov = buf.get_u16_le()?;
32801 __struct.stream_id = buf.get_u8()?;
32802 __struct.count = buf.get_u8()?;
32803 let tmp = buf.get_u8()?;
32804 __struct.mavtype =
32805 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32806 enum_type: "VideoStreamType",
32807 value: tmp as u64,
32808 })?;
32809 let mut tmp = [0_u8; 32usize];
32810 for v in &mut tmp {
32811 *v = buf.get_u8()?;
32812 }
32813 __struct.name = CharArray::new(tmp);
32814 let mut tmp = [0_u8; 160usize];
32815 for v in &mut tmp {
32816 *v = buf.get_u8()?;
32817 }
32818 __struct.uri = CharArray::new(tmp);
32819 let tmp = buf.get_u8()?;
32820 __struct.encoding =
32821 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32822 enum_type: "VideoStreamEncoding",
32823 value: tmp as u64,
32824 })?;
32825 __struct.camera_device_id = buf.get_u8()?;
32826 Ok(__struct)
32827 }
32828 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32829 let mut __tmp = BytesMut::new(bytes);
32830 #[allow(clippy::absurd_extreme_comparisons)]
32831 #[allow(unused_comparisons)]
32832 if __tmp.remaining() < Self::ENCODED_LEN {
32833 panic!(
32834 "buffer is too small (need {} bytes, but got {})",
32835 Self::ENCODED_LEN,
32836 __tmp.remaining(),
32837 )
32838 }
32839 __tmp.put_f32_le(self.framerate);
32840 __tmp.put_u32_le(self.bitrate);
32841 __tmp.put_u16_le(self.flags.bits() as u16);
32842 __tmp.put_u16_le(self.resolution_h);
32843 __tmp.put_u16_le(self.resolution_v);
32844 __tmp.put_u16_le(self.rotation);
32845 __tmp.put_u16_le(self.hfov);
32846 __tmp.put_u8(self.stream_id);
32847 __tmp.put_u8(self.count);
32848 __tmp.put_u8(self.mavtype as u8);
32849 for val in &self.name {
32850 __tmp.put_u8(*val);
32851 }
32852 for val in &self.uri {
32853 __tmp.put_u8(*val);
32854 }
32855 if matches!(version, MavlinkVersion::V2) {
32856 __tmp.put_u8(self.encoding as u8);
32857 __tmp.put_u8(self.camera_device_id);
32858 let len = __tmp.len();
32859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32860 } else {
32861 __tmp.len()
32862 }
32863 }
32864}
32865#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32866#[doc = ""]
32867#[doc = "ID: 270"]
32868#[derive(Debug, Clone, PartialEq)]
32869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32871#[cfg_attr(feature = "ts", derive(TS))]
32872#[cfg_attr(feature = "ts", ts(export))]
32873pub struct VIDEO_STREAM_STATUS_DATA {
32874 #[doc = "Frame rate"]
32875 pub framerate: f32,
32876 #[doc = "Bit rate"]
32877 pub bitrate: u32,
32878 #[doc = "Bitmap of stream status flags"]
32879 pub flags: VideoStreamStatusFlags,
32880 #[doc = "Horizontal resolution"]
32881 pub resolution_h: u16,
32882 #[doc = "Vertical resolution"]
32883 pub resolution_v: u16,
32884 #[doc = "Video image rotation clockwise"]
32885 pub rotation: u16,
32886 #[doc = "Horizontal Field of view"]
32887 pub hfov: u16,
32888 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32889 pub stream_id: u8,
32890 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32892 pub camera_device_id: u8,
32893}
32894impl VIDEO_STREAM_STATUS_DATA {
32895 pub const ENCODED_LEN: usize = 20usize;
32896 pub const DEFAULT: Self = Self {
32897 framerate: 0.0_f32,
32898 bitrate: 0_u32,
32899 flags: VideoStreamStatusFlags::DEFAULT,
32900 resolution_h: 0_u16,
32901 resolution_v: 0_u16,
32902 rotation: 0_u16,
32903 hfov: 0_u16,
32904 stream_id: 0_u8,
32905 camera_device_id: 0_u8,
32906 };
32907 #[cfg(feature = "arbitrary")]
32908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32909 use arbitrary::{Arbitrary, Unstructured};
32910 let mut buf = [0u8; 1024];
32911 rng.fill_bytes(&mut buf);
32912 let mut unstructured = Unstructured::new(&buf);
32913 Self::arbitrary(&mut unstructured).unwrap_or_default()
32914 }
32915}
32916impl Default for VIDEO_STREAM_STATUS_DATA {
32917 fn default() -> Self {
32918 Self::DEFAULT.clone()
32919 }
32920}
32921impl MessageData for VIDEO_STREAM_STATUS_DATA {
32922 type Message = MavMessage;
32923 const ID: u32 = 270u32;
32924 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32925 const EXTRA_CRC: u8 = 59u8;
32926 const ENCODED_LEN: usize = 20usize;
32927 fn deser(
32928 _version: MavlinkVersion,
32929 __input: &[u8],
32930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32931 let avail_len = __input.len();
32932 let mut payload_buf = [0; Self::ENCODED_LEN];
32933 let mut buf = if avail_len < Self::ENCODED_LEN {
32934 payload_buf[0..avail_len].copy_from_slice(__input);
32935 Bytes::new(&payload_buf)
32936 } else {
32937 Bytes::new(__input)
32938 };
32939 let mut __struct = Self::default();
32940 __struct.framerate = buf.get_f32_le()?;
32941 __struct.bitrate = buf.get_u32_le()?;
32942 let tmp = buf.get_u16_le()?;
32943 __struct.flags =
32944 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32945 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32946 flag_type: "VideoStreamStatusFlags",
32947 value: tmp as u64,
32948 })?;
32949 __struct.resolution_h = buf.get_u16_le()?;
32950 __struct.resolution_v = buf.get_u16_le()?;
32951 __struct.rotation = buf.get_u16_le()?;
32952 __struct.hfov = buf.get_u16_le()?;
32953 __struct.stream_id = buf.get_u8()?;
32954 __struct.camera_device_id = buf.get_u8()?;
32955 Ok(__struct)
32956 }
32957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32958 let mut __tmp = BytesMut::new(bytes);
32959 #[allow(clippy::absurd_extreme_comparisons)]
32960 #[allow(unused_comparisons)]
32961 if __tmp.remaining() < Self::ENCODED_LEN {
32962 panic!(
32963 "buffer is too small (need {} bytes, but got {})",
32964 Self::ENCODED_LEN,
32965 __tmp.remaining(),
32966 )
32967 }
32968 __tmp.put_f32_le(self.framerate);
32969 __tmp.put_u32_le(self.bitrate);
32970 __tmp.put_u16_le(self.flags.bits() as u16);
32971 __tmp.put_u16_le(self.resolution_h);
32972 __tmp.put_u16_le(self.resolution_v);
32973 __tmp.put_u16_le(self.rotation);
32974 __tmp.put_u16_le(self.hfov);
32975 __tmp.put_u8(self.stream_id);
32976 if matches!(version, MavlinkVersion::V2) {
32977 __tmp.put_u8(self.camera_device_id);
32978 let len = __tmp.len();
32979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32980 } else {
32981 __tmp.len()
32982 }
32983 }
32984}
32985#[doc = "Local position/attitude estimate from a vision source."]
32986#[doc = ""]
32987#[doc = "ID: 102"]
32988#[derive(Debug, Clone, PartialEq)]
32989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32991#[cfg_attr(feature = "ts", derive(TS))]
32992#[cfg_attr(feature = "ts", ts(export))]
32993pub struct VISION_POSITION_ESTIMATE_DATA {
32994 #[doc = "Timestamp (UNIX time or time since system boot)"]
32995 pub usec: u64,
32996 #[doc = "Local X position"]
32997 pub x: f32,
32998 #[doc = "Local Y position"]
32999 pub y: f32,
33000 #[doc = "Local Z position"]
33001 pub z: f32,
33002 #[doc = "Roll angle"]
33003 pub roll: f32,
33004 #[doc = "Pitch angle"]
33005 pub pitch: f32,
33006 #[doc = "Yaw angle"]
33007 pub yaw: f32,
33008 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
33009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33011 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33012 pub covariance: [f32; 21],
33013 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33015 pub reset_counter: u8,
33016}
33017impl VISION_POSITION_ESTIMATE_DATA {
33018 pub const ENCODED_LEN: usize = 117usize;
33019 pub const DEFAULT: Self = Self {
33020 usec: 0_u64,
33021 x: 0.0_f32,
33022 y: 0.0_f32,
33023 z: 0.0_f32,
33024 roll: 0.0_f32,
33025 pitch: 0.0_f32,
33026 yaw: 0.0_f32,
33027 covariance: [0.0_f32; 21usize],
33028 reset_counter: 0_u8,
33029 };
33030 #[cfg(feature = "arbitrary")]
33031 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33032 use arbitrary::{Arbitrary, Unstructured};
33033 let mut buf = [0u8; 1024];
33034 rng.fill_bytes(&mut buf);
33035 let mut unstructured = Unstructured::new(&buf);
33036 Self::arbitrary(&mut unstructured).unwrap_or_default()
33037 }
33038}
33039impl Default for VISION_POSITION_ESTIMATE_DATA {
33040 fn default() -> Self {
33041 Self::DEFAULT.clone()
33042 }
33043}
33044impl MessageData for VISION_POSITION_ESTIMATE_DATA {
33045 type Message = MavMessage;
33046 const ID: u32 = 102u32;
33047 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
33048 const EXTRA_CRC: u8 = 158u8;
33049 const ENCODED_LEN: usize = 117usize;
33050 fn deser(
33051 _version: MavlinkVersion,
33052 __input: &[u8],
33053 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33054 let avail_len = __input.len();
33055 let mut payload_buf = [0; Self::ENCODED_LEN];
33056 let mut buf = if avail_len < Self::ENCODED_LEN {
33057 payload_buf[0..avail_len].copy_from_slice(__input);
33058 Bytes::new(&payload_buf)
33059 } else {
33060 Bytes::new(__input)
33061 };
33062 let mut __struct = Self::default();
33063 __struct.usec = buf.get_u64_le()?;
33064 __struct.x = buf.get_f32_le()?;
33065 __struct.y = buf.get_f32_le()?;
33066 __struct.z = buf.get_f32_le()?;
33067 __struct.roll = buf.get_f32_le()?;
33068 __struct.pitch = buf.get_f32_le()?;
33069 __struct.yaw = buf.get_f32_le()?;
33070 for v in &mut __struct.covariance {
33071 let val = buf.get_f32_le()?;
33072 *v = val;
33073 }
33074 __struct.reset_counter = buf.get_u8()?;
33075 Ok(__struct)
33076 }
33077 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33078 let mut __tmp = BytesMut::new(bytes);
33079 #[allow(clippy::absurd_extreme_comparisons)]
33080 #[allow(unused_comparisons)]
33081 if __tmp.remaining() < Self::ENCODED_LEN {
33082 panic!(
33083 "buffer is too small (need {} bytes, but got {})",
33084 Self::ENCODED_LEN,
33085 __tmp.remaining(),
33086 )
33087 }
33088 __tmp.put_u64_le(self.usec);
33089 __tmp.put_f32_le(self.x);
33090 __tmp.put_f32_le(self.y);
33091 __tmp.put_f32_le(self.z);
33092 __tmp.put_f32_le(self.roll);
33093 __tmp.put_f32_le(self.pitch);
33094 __tmp.put_f32_le(self.yaw);
33095 if matches!(version, MavlinkVersion::V2) {
33096 for val in &self.covariance {
33097 __tmp.put_f32_le(*val);
33098 }
33099 __tmp.put_u8(self.reset_counter);
33100 let len = __tmp.len();
33101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33102 } else {
33103 __tmp.len()
33104 }
33105 }
33106}
33107#[doc = "Speed estimate from a vision source."]
33108#[doc = ""]
33109#[doc = "ID: 103"]
33110#[derive(Debug, Clone, PartialEq)]
33111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33113#[cfg_attr(feature = "ts", derive(TS))]
33114#[cfg_attr(feature = "ts", ts(export))]
33115pub struct VISION_SPEED_ESTIMATE_DATA {
33116 #[doc = "Timestamp (UNIX time or time since system boot)"]
33117 pub usec: u64,
33118 #[doc = "Global X speed"]
33119 pub x: f32,
33120 #[doc = "Global Y speed"]
33121 pub y: f32,
33122 #[doc = "Global Z speed"]
33123 pub z: f32,
33124 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
33125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33127 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33128 pub covariance: [f32; 9],
33129 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
33130 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33131 pub reset_counter: u8,
33132}
33133impl VISION_SPEED_ESTIMATE_DATA {
33134 pub const ENCODED_LEN: usize = 57usize;
33135 pub const DEFAULT: Self = Self {
33136 usec: 0_u64,
33137 x: 0.0_f32,
33138 y: 0.0_f32,
33139 z: 0.0_f32,
33140 covariance: [0.0_f32; 9usize],
33141 reset_counter: 0_u8,
33142 };
33143 #[cfg(feature = "arbitrary")]
33144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33145 use arbitrary::{Arbitrary, Unstructured};
33146 let mut buf = [0u8; 1024];
33147 rng.fill_bytes(&mut buf);
33148 let mut unstructured = Unstructured::new(&buf);
33149 Self::arbitrary(&mut unstructured).unwrap_or_default()
33150 }
33151}
33152impl Default for VISION_SPEED_ESTIMATE_DATA {
33153 fn default() -> Self {
33154 Self::DEFAULT.clone()
33155 }
33156}
33157impl MessageData for VISION_SPEED_ESTIMATE_DATA {
33158 type Message = MavMessage;
33159 const ID: u32 = 103u32;
33160 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
33161 const EXTRA_CRC: u8 = 208u8;
33162 const ENCODED_LEN: usize = 57usize;
33163 fn deser(
33164 _version: MavlinkVersion,
33165 __input: &[u8],
33166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33167 let avail_len = __input.len();
33168 let mut payload_buf = [0; Self::ENCODED_LEN];
33169 let mut buf = if avail_len < Self::ENCODED_LEN {
33170 payload_buf[0..avail_len].copy_from_slice(__input);
33171 Bytes::new(&payload_buf)
33172 } else {
33173 Bytes::new(__input)
33174 };
33175 let mut __struct = Self::default();
33176 __struct.usec = buf.get_u64_le()?;
33177 __struct.x = buf.get_f32_le()?;
33178 __struct.y = buf.get_f32_le()?;
33179 __struct.z = buf.get_f32_le()?;
33180 for v in &mut __struct.covariance {
33181 let val = buf.get_f32_le()?;
33182 *v = val;
33183 }
33184 __struct.reset_counter = buf.get_u8()?;
33185 Ok(__struct)
33186 }
33187 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33188 let mut __tmp = BytesMut::new(bytes);
33189 #[allow(clippy::absurd_extreme_comparisons)]
33190 #[allow(unused_comparisons)]
33191 if __tmp.remaining() < Self::ENCODED_LEN {
33192 panic!(
33193 "buffer is too small (need {} bytes, but got {})",
33194 Self::ENCODED_LEN,
33195 __tmp.remaining(),
33196 )
33197 }
33198 __tmp.put_u64_le(self.usec);
33199 __tmp.put_f32_le(self.x);
33200 __tmp.put_f32_le(self.y);
33201 __tmp.put_f32_le(self.z);
33202 if matches!(version, MavlinkVersion::V2) {
33203 for val in &self.covariance {
33204 __tmp.put_f32_le(*val);
33205 }
33206 __tmp.put_u8(self.reset_counter);
33207 let len = __tmp.len();
33208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33209 } else {
33210 __tmp.len()
33211 }
33212 }
33213}
33214#[doc = "Cumulative distance traveled for each reported wheel."]
33215#[doc = ""]
33216#[doc = "ID: 9000"]
33217#[derive(Debug, Clone, PartialEq)]
33218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33220#[cfg_attr(feature = "ts", derive(TS))]
33221#[cfg_attr(feature = "ts", ts(export))]
33222pub struct WHEEL_DISTANCE_DATA {
33223 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
33224 pub time_usec: u64,
33225 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
33226 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33227 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
33228 pub distance: [f64; 16],
33229 #[doc = "Number of wheels reported."]
33230 pub count: u8,
33231}
33232impl WHEEL_DISTANCE_DATA {
33233 pub const ENCODED_LEN: usize = 137usize;
33234 pub const DEFAULT: Self = Self {
33235 time_usec: 0_u64,
33236 distance: [0.0_f64; 16usize],
33237 count: 0_u8,
33238 };
33239 #[cfg(feature = "arbitrary")]
33240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33241 use arbitrary::{Arbitrary, Unstructured};
33242 let mut buf = [0u8; 1024];
33243 rng.fill_bytes(&mut buf);
33244 let mut unstructured = Unstructured::new(&buf);
33245 Self::arbitrary(&mut unstructured).unwrap_or_default()
33246 }
33247}
33248impl Default for WHEEL_DISTANCE_DATA {
33249 fn default() -> Self {
33250 Self::DEFAULT.clone()
33251 }
33252}
33253impl MessageData for WHEEL_DISTANCE_DATA {
33254 type Message = MavMessage;
33255 const ID: u32 = 9000u32;
33256 const NAME: &'static str = "WHEEL_DISTANCE";
33257 const EXTRA_CRC: u8 = 113u8;
33258 const ENCODED_LEN: usize = 137usize;
33259 fn deser(
33260 _version: MavlinkVersion,
33261 __input: &[u8],
33262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33263 let avail_len = __input.len();
33264 let mut payload_buf = [0; Self::ENCODED_LEN];
33265 let mut buf = if avail_len < Self::ENCODED_LEN {
33266 payload_buf[0..avail_len].copy_from_slice(__input);
33267 Bytes::new(&payload_buf)
33268 } else {
33269 Bytes::new(__input)
33270 };
33271 let mut __struct = Self::default();
33272 __struct.time_usec = buf.get_u64_le()?;
33273 for v in &mut __struct.distance {
33274 let val = buf.get_f64_le()?;
33275 *v = val;
33276 }
33277 __struct.count = buf.get_u8()?;
33278 Ok(__struct)
33279 }
33280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33281 let mut __tmp = BytesMut::new(bytes);
33282 #[allow(clippy::absurd_extreme_comparisons)]
33283 #[allow(unused_comparisons)]
33284 if __tmp.remaining() < Self::ENCODED_LEN {
33285 panic!(
33286 "buffer is too small (need {} bytes, but got {})",
33287 Self::ENCODED_LEN,
33288 __tmp.remaining(),
33289 )
33290 }
33291 __tmp.put_u64_le(self.time_usec);
33292 for val in &self.distance {
33293 __tmp.put_f64_le(*val);
33294 }
33295 __tmp.put_u8(self.count);
33296 if matches!(version, MavlinkVersion::V2) {
33297 let len = __tmp.len();
33298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33299 } else {
33300 __tmp.len()
33301 }
33302 }
33303}
33304#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33305#[doc = ""]
33306#[doc = "ID: 299"]
33307#[derive(Debug, Clone, PartialEq)]
33308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33310#[cfg_attr(feature = "ts", derive(TS))]
33311#[cfg_attr(feature = "ts", ts(export))]
33312pub struct WIFI_CONFIG_AP_DATA {
33313 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
33314 #[cfg_attr(feature = "ts", ts(type = "string"))]
33315 pub ssid: CharArray<32>,
33316 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
33317 #[cfg_attr(feature = "ts", ts(type = "string"))]
33318 pub password: CharArray<64>,
33319 #[doc = "WiFi Mode."]
33320 #[cfg_attr(feature = "serde", serde(default))]
33321 pub mode: WifiConfigApMode,
33322 #[doc = "Message acceptance response (sent back to GS)."]
33323 #[cfg_attr(feature = "serde", serde(default))]
33324 pub response: WifiConfigApResponse,
33325}
33326impl WIFI_CONFIG_AP_DATA {
33327 pub const ENCODED_LEN: usize = 98usize;
33328 pub const DEFAULT: Self = Self {
33329 ssid: CharArray::new([0_u8; 32usize]),
33330 password: CharArray::new([0_u8; 64usize]),
33331 mode: WifiConfigApMode::DEFAULT,
33332 response: WifiConfigApResponse::DEFAULT,
33333 };
33334 #[cfg(feature = "arbitrary")]
33335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33336 use arbitrary::{Arbitrary, Unstructured};
33337 let mut buf = [0u8; 1024];
33338 rng.fill_bytes(&mut buf);
33339 let mut unstructured = Unstructured::new(&buf);
33340 Self::arbitrary(&mut unstructured).unwrap_or_default()
33341 }
33342}
33343impl Default for WIFI_CONFIG_AP_DATA {
33344 fn default() -> Self {
33345 Self::DEFAULT.clone()
33346 }
33347}
33348impl MessageData for WIFI_CONFIG_AP_DATA {
33349 type Message = MavMessage;
33350 const ID: u32 = 299u32;
33351 const NAME: &'static str = "WIFI_CONFIG_AP";
33352 const EXTRA_CRC: u8 = 19u8;
33353 const ENCODED_LEN: usize = 98usize;
33354 fn deser(
33355 _version: MavlinkVersion,
33356 __input: &[u8],
33357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33358 let avail_len = __input.len();
33359 let mut payload_buf = [0; Self::ENCODED_LEN];
33360 let mut buf = if avail_len < Self::ENCODED_LEN {
33361 payload_buf[0..avail_len].copy_from_slice(__input);
33362 Bytes::new(&payload_buf)
33363 } else {
33364 Bytes::new(__input)
33365 };
33366 let mut __struct = Self::default();
33367 let mut tmp = [0_u8; 32usize];
33368 for v in &mut tmp {
33369 *v = buf.get_u8()?;
33370 }
33371 __struct.ssid = CharArray::new(tmp);
33372 let mut tmp = [0_u8; 64usize];
33373 for v in &mut tmp {
33374 *v = buf.get_u8()?;
33375 }
33376 __struct.password = CharArray::new(tmp);
33377 let tmp = buf.get_i8()?;
33378 __struct.mode =
33379 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33380 enum_type: "WifiConfigApMode",
33381 value: tmp as u64,
33382 })?;
33383 let tmp = buf.get_i8()?;
33384 __struct.response =
33385 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33386 enum_type: "WifiConfigApResponse",
33387 value: tmp as u64,
33388 })?;
33389 Ok(__struct)
33390 }
33391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33392 let mut __tmp = BytesMut::new(bytes);
33393 #[allow(clippy::absurd_extreme_comparisons)]
33394 #[allow(unused_comparisons)]
33395 if __tmp.remaining() < Self::ENCODED_LEN {
33396 panic!(
33397 "buffer is too small (need {} bytes, but got {})",
33398 Self::ENCODED_LEN,
33399 __tmp.remaining(),
33400 )
33401 }
33402 for val in &self.ssid {
33403 __tmp.put_u8(*val);
33404 }
33405 for val in &self.password {
33406 __tmp.put_u8(*val);
33407 }
33408 if matches!(version, MavlinkVersion::V2) {
33409 __tmp.put_i8(self.mode as i8);
33410 __tmp.put_i8(self.response as i8);
33411 let len = __tmp.len();
33412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33413 } else {
33414 __tmp.len()
33415 }
33416 }
33417}
33418#[doc = "Winch status."]
33419#[doc = ""]
33420#[doc = "ID: 9005"]
33421#[derive(Debug, Clone, PartialEq)]
33422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33424#[cfg_attr(feature = "ts", derive(TS))]
33425#[cfg_attr(feature = "ts", ts(export))]
33426pub struct WINCH_STATUS_DATA {
33427 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
33428 pub time_usec: u64,
33429 #[doc = "Length of line released. NaN if unknown"]
33430 pub line_length: f32,
33431 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
33432 pub speed: f32,
33433 #[doc = "Tension on the line. NaN if unknown"]
33434 pub tension: f32,
33435 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
33436 pub voltage: f32,
33437 #[doc = "Current draw from the winch. NaN if unknown"]
33438 pub current: f32,
33439 #[doc = "Status flags"]
33440 pub status: MavWinchStatusFlag,
33441 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
33442 pub temperature: i16,
33443}
33444impl WINCH_STATUS_DATA {
33445 pub const ENCODED_LEN: usize = 34usize;
33446 pub const DEFAULT: Self = Self {
33447 time_usec: 0_u64,
33448 line_length: 0.0_f32,
33449 speed: 0.0_f32,
33450 tension: 0.0_f32,
33451 voltage: 0.0_f32,
33452 current: 0.0_f32,
33453 status: MavWinchStatusFlag::DEFAULT,
33454 temperature: 0_i16,
33455 };
33456 #[cfg(feature = "arbitrary")]
33457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33458 use arbitrary::{Arbitrary, Unstructured};
33459 let mut buf = [0u8; 1024];
33460 rng.fill_bytes(&mut buf);
33461 let mut unstructured = Unstructured::new(&buf);
33462 Self::arbitrary(&mut unstructured).unwrap_or_default()
33463 }
33464}
33465impl Default for WINCH_STATUS_DATA {
33466 fn default() -> Self {
33467 Self::DEFAULT.clone()
33468 }
33469}
33470impl MessageData for WINCH_STATUS_DATA {
33471 type Message = MavMessage;
33472 const ID: u32 = 9005u32;
33473 const NAME: &'static str = "WINCH_STATUS";
33474 const EXTRA_CRC: u8 = 117u8;
33475 const ENCODED_LEN: usize = 34usize;
33476 fn deser(
33477 _version: MavlinkVersion,
33478 __input: &[u8],
33479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33480 let avail_len = __input.len();
33481 let mut payload_buf = [0; Self::ENCODED_LEN];
33482 let mut buf = if avail_len < Self::ENCODED_LEN {
33483 payload_buf[0..avail_len].copy_from_slice(__input);
33484 Bytes::new(&payload_buf)
33485 } else {
33486 Bytes::new(__input)
33487 };
33488 let mut __struct = Self::default();
33489 __struct.time_usec = buf.get_u64_le()?;
33490 __struct.line_length = buf.get_f32_le()?;
33491 __struct.speed = buf.get_f32_le()?;
33492 __struct.tension = buf.get_f32_le()?;
33493 __struct.voltage = buf.get_f32_le()?;
33494 __struct.current = buf.get_f32_le()?;
33495 let tmp = buf.get_u32_le()?;
33496 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
33497 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33498 flag_type: "MavWinchStatusFlag",
33499 value: tmp as u64,
33500 })?;
33501 __struct.temperature = buf.get_i16_le()?;
33502 Ok(__struct)
33503 }
33504 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33505 let mut __tmp = BytesMut::new(bytes);
33506 #[allow(clippy::absurd_extreme_comparisons)]
33507 #[allow(unused_comparisons)]
33508 if __tmp.remaining() < Self::ENCODED_LEN {
33509 panic!(
33510 "buffer is too small (need {} bytes, but got {})",
33511 Self::ENCODED_LEN,
33512 __tmp.remaining(),
33513 )
33514 }
33515 __tmp.put_u64_le(self.time_usec);
33516 __tmp.put_f32_le(self.line_length);
33517 __tmp.put_f32_le(self.speed);
33518 __tmp.put_f32_le(self.tension);
33519 __tmp.put_f32_le(self.voltage);
33520 __tmp.put_f32_le(self.current);
33521 __tmp.put_u32_le(self.status.bits() as u32);
33522 __tmp.put_i16_le(self.temperature);
33523 if matches!(version, MavlinkVersion::V2) {
33524 let len = __tmp.len();
33525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33526 } else {
33527 __tmp.len()
33528 }
33529 }
33530}
33531#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33532#[doc = ""]
33533#[doc = "ID: 231"]
33534#[derive(Debug, Clone, PartialEq)]
33535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33537#[cfg_attr(feature = "ts", derive(TS))]
33538#[cfg_attr(feature = "ts", ts(export))]
33539pub struct WIND_COV_DATA {
33540 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33541 pub time_usec: u64,
33542 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
33543 pub wind_x: f32,
33544 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
33545 pub wind_y: f32,
33546 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
33547 pub wind_z: f32,
33548 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
33549 pub var_horiz: f32,
33550 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
33551 pub var_vert: f32,
33552 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
33553 pub wind_alt: f32,
33554 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
33555 pub horiz_accuracy: f32,
33556 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
33557 pub vert_accuracy: f32,
33558}
33559impl WIND_COV_DATA {
33560 pub const ENCODED_LEN: usize = 40usize;
33561 pub const DEFAULT: Self = Self {
33562 time_usec: 0_u64,
33563 wind_x: 0.0_f32,
33564 wind_y: 0.0_f32,
33565 wind_z: 0.0_f32,
33566 var_horiz: 0.0_f32,
33567 var_vert: 0.0_f32,
33568 wind_alt: 0.0_f32,
33569 horiz_accuracy: 0.0_f32,
33570 vert_accuracy: 0.0_f32,
33571 };
33572 #[cfg(feature = "arbitrary")]
33573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33574 use arbitrary::{Arbitrary, Unstructured};
33575 let mut buf = [0u8; 1024];
33576 rng.fill_bytes(&mut buf);
33577 let mut unstructured = Unstructured::new(&buf);
33578 Self::arbitrary(&mut unstructured).unwrap_or_default()
33579 }
33580}
33581impl Default for WIND_COV_DATA {
33582 fn default() -> Self {
33583 Self::DEFAULT.clone()
33584 }
33585}
33586impl MessageData for WIND_COV_DATA {
33587 type Message = MavMessage;
33588 const ID: u32 = 231u32;
33589 const NAME: &'static str = "WIND_COV";
33590 const EXTRA_CRC: u8 = 105u8;
33591 const ENCODED_LEN: usize = 40usize;
33592 fn deser(
33593 _version: MavlinkVersion,
33594 __input: &[u8],
33595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33596 let avail_len = __input.len();
33597 let mut payload_buf = [0; Self::ENCODED_LEN];
33598 let mut buf = if avail_len < Self::ENCODED_LEN {
33599 payload_buf[0..avail_len].copy_from_slice(__input);
33600 Bytes::new(&payload_buf)
33601 } else {
33602 Bytes::new(__input)
33603 };
33604 let mut __struct = Self::default();
33605 __struct.time_usec = buf.get_u64_le()?;
33606 __struct.wind_x = buf.get_f32_le()?;
33607 __struct.wind_y = buf.get_f32_le()?;
33608 __struct.wind_z = buf.get_f32_le()?;
33609 __struct.var_horiz = buf.get_f32_le()?;
33610 __struct.var_vert = buf.get_f32_le()?;
33611 __struct.wind_alt = buf.get_f32_le()?;
33612 __struct.horiz_accuracy = buf.get_f32_le()?;
33613 __struct.vert_accuracy = buf.get_f32_le()?;
33614 Ok(__struct)
33615 }
33616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33617 let mut __tmp = BytesMut::new(bytes);
33618 #[allow(clippy::absurd_extreme_comparisons)]
33619 #[allow(unused_comparisons)]
33620 if __tmp.remaining() < Self::ENCODED_LEN {
33621 panic!(
33622 "buffer is too small (need {} bytes, but got {})",
33623 Self::ENCODED_LEN,
33624 __tmp.remaining(),
33625 )
33626 }
33627 __tmp.put_u64_le(self.time_usec);
33628 __tmp.put_f32_le(self.wind_x);
33629 __tmp.put_f32_le(self.wind_y);
33630 __tmp.put_f32_le(self.wind_z);
33631 __tmp.put_f32_le(self.var_horiz);
33632 __tmp.put_f32_le(self.var_vert);
33633 __tmp.put_f32_le(self.wind_alt);
33634 __tmp.put_f32_le(self.horiz_accuracy);
33635 __tmp.put_f32_le(self.vert_accuracy);
33636 if matches!(version, MavlinkVersion::V2) {
33637 let len = __tmp.len();
33638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33639 } else {
33640 __tmp.len()
33641 }
33642 }
33643}
33644#[derive(Clone, PartialEq, Debug)]
33645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33646#[cfg_attr(feature = "serde", serde(tag = "type"))]
33647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33648#[cfg_attr(feature = "ts", derive(TS))]
33649#[cfg_attr(feature = "ts", ts(export))]
33650#[repr(u32)]
33651pub enum MavMessage {
33652 #[doc = "Set the vehicle attitude and body angular rates."]
33653 #[doc = ""]
33654 #[doc = "ID: 140"]
33655 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
33656 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
33657 #[doc = ""]
33658 #[doc = "ID: 375"]
33659 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
33660 #[doc = "The location and information of an ADSB vehicle."]
33661 #[doc = ""]
33662 #[doc = "ID: 246"]
33663 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
33664 #[doc = "Airspeed information from a sensor."]
33665 #[doc = ""]
33666 #[doc = "ID: 295"]
33667 AIRSPEED(AIRSPEED_DATA),
33668 #[doc = "The location and information of an AIS vessel."]
33669 #[doc = ""]
33670 #[doc = "ID: 301"]
33671 AIS_VESSEL(AIS_VESSEL_DATA),
33672 #[doc = "The current system altitude."]
33673 #[doc = ""]
33674 #[doc = "ID: 141"]
33675 ALTITUDE(ALTITUDE_DATA),
33676 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
33677 #[doc = ""]
33678 #[doc = "ID: 30"]
33679 ATTITUDE(ATTITUDE_DATA),
33680 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33681 #[doc = ""]
33682 #[doc = "ID: 31"]
33683 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
33684 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33685 #[doc = ""]
33686 #[doc = "ID: 61"]
33687 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
33688 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
33689 #[doc = ""]
33690 #[doc = "ID: 83"]
33691 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
33692 #[doc = "Motion capture attitude and position."]
33693 #[doc = ""]
33694 #[doc = "ID: 138"]
33695 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
33696 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
33697 #[doc = ""]
33698 #[doc = "ID: 7"]
33699 AUTH_KEY(AUTH_KEY_DATA),
33700 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
33701 #[doc = ""]
33702 #[doc = "ID: 286"]
33703 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
33704 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
33705 #[doc = ""]
33706 #[doc = "ID: 148"]
33707 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
33708 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
33709 #[doc = ""]
33710 #[doc = "ID: 435"]
33711 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
33712 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
33713 #[doc = ""]
33714 #[doc = "ID: 437"]
33715 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
33716 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
33717 #[doc = ""]
33718 #[doc = "ID: 372"]
33719 BATTERY_INFO(BATTERY_INFO_DATA),
33720 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
33721 #[doc = ""]
33722 #[doc = "ID: 147"]
33723 BATTERY_STATUS(BATTERY_STATUS_DATA),
33724 #[doc = "Battery dynamic information. This should be streamed (nominally at 1Hz). Static/invariant battery information is sent in BATTERY_INFO. Note that smart batteries should set the MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL bit to indicate that supplied capacity values are relative to a battery that is known to be full. Power monitors would not set this bit, indicating that capacity_consumed is relative to drone power-on, and that other values are estimated based on the assumption that the battery was full on power-on."]
33725 #[doc = ""]
33726 #[doc = "ID: 369"]
33727 BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA),
33728 #[doc = "Report button state change."]
33729 #[doc = ""]
33730 #[doc = "ID: 257"]
33731 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33732 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33733 #[doc = ""]
33734 #[doc = "ID: 262"]
33735 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33736 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33737 #[doc = ""]
33738 #[doc = "ID: 271"]
33739 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33740 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
33741 #[doc = ""]
33742 #[doc = "ID: 263"]
33743 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33744 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33745 #[doc = ""]
33746 #[doc = "ID: 259"]
33747 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33748 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33749 #[doc = ""]
33750 #[doc = "ID: 260"]
33751 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33752 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
33753 #[doc = ""]
33754 #[doc = "ID: 277"]
33755 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33756 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33757 #[doc = ""]
33758 #[doc = "ID: 276"]
33759 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33760 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33761 #[doc = ""]
33762 #[doc = "ID: 275"]
33763 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33764 #[doc = "Camera-IMU triggering and synchronisation message."]
33765 #[doc = ""]
33766 #[doc = "ID: 112"]
33767 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33768 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
33769 #[doc = ""]
33770 #[doc = "ID: 387"]
33771 CANFD_FRAME(CANFD_FRAME_DATA),
33772 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
33773 #[doc = ""]
33774 #[doc = "ID: 388"]
33775 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33776 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
33777 #[doc = ""]
33778 #[doc = "ID: 386"]
33779 CAN_FRAME(CAN_FRAME_DATA),
33780 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33781 #[doc = ""]
33782 #[doc = "ID: 336"]
33783 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33784 #[doc = "Report current used cellular network status."]
33785 #[doc = ""]
33786 #[doc = "ID: 334"]
33787 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33788 #[doc = "Request to control this MAV."]
33789 #[doc = ""]
33790 #[doc = "ID: 5"]
33791 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33792 #[doc = "Accept / deny control of this MAV."]
33793 #[doc = ""]
33794 #[doc = "ID: 6"]
33795 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33796 #[doc = "Information about a potential collision."]
33797 #[doc = ""]
33798 #[doc = "ID: 247"]
33799 COLLISION(COLLISION_DATA),
33800 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33801 #[doc = ""]
33802 #[doc = "ID: 77"]
33803 COMMAND_ACK(COMMAND_ACK_DATA),
33804 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33805 #[doc = ""]
33806 #[doc = "ID: 80"]
33807 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33808 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33809 #[doc = ""]
33810 #[doc = "ID: 75"]
33811 COMMAND_INT(COMMAND_INT_DATA),
33812 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33813 #[doc = ""]
33814 #[doc = "ID: 76"]
33815 COMMAND_LONG(COMMAND_LONG_DATA),
33816 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
33817 #[doc = ""]
33818 #[doc = "ID: 395"]
33819 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33820 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33821 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
33822 #[doc = ""]
33823 #[doc = "ID: 396"]
33824 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33825 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
33826 #[doc = ""]
33827 #[doc = "ID: 397"]
33828 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33829 #[doc = "Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL."]
33830 #[doc = ""]
33831 #[doc = "ID: 512"]
33832 CONTROL_STATUS(CONTROL_STATUS_DATA),
33833 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
33834 #[doc = ""]
33835 #[doc = "ID: 146"]
33836 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33837 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
33838 #[doc = ""]
33839 #[doc = "ID: 411"]
33840 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33841 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33842 #[doc = ""]
33843 #[doc = "ID: 436"]
33844 CURRENT_MODE(CURRENT_MODE_DATA),
33845 #[doc = "Data stream status information."]
33846 #[doc = ""]
33847 #[doc = "ID: 67"]
33848 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33849 DATA_STREAM(DATA_STREAM_DATA),
33850 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33851 #[doc = ""]
33852 #[doc = "ID: 130"]
33853 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33854 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33855 #[doc = ""]
33856 #[doc = "ID: 254"]
33857 DEBUG(DEBUG_DATA),
33858 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33859 #[doc = ""]
33860 #[doc = "ID: 350"]
33861 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33862 #[doc = "To debug something using a named 3D vector."]
33863 #[doc = ""]
33864 #[doc = "ID: 250"]
33865 DEBUG_VECT(DEBUG_VECT_DATA),
33866 #[doc = "Distance sensor information for an onboard rangefinder."]
33867 #[doc = ""]
33868 #[doc = "ID: 132"]
33869 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33870 #[doc = "EFI status output."]
33871 #[doc = ""]
33872 #[doc = "ID: 225"]
33873 EFI_STATUS(EFI_STATUS_DATA),
33874 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33875 #[doc = ""]
33876 #[doc = "ID: 131"]
33877 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33878 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33879 #[doc = ""]
33880 #[doc = "ID: 290"]
33881 ESC_INFO(ESC_INFO_DATA),
33882 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33883 #[doc = ""]
33884 #[doc = "ID: 291"]
33885 ESC_STATUS(ESC_STATUS_DATA),
33886 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33887 #[doc = ""]
33888 #[doc = "ID: 230"]
33889 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33890 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33891 #[doc = ""]
33892 #[doc = "ID: 410"]
33893 EVENT(EVENT_DATA),
33894 #[doc = "Provides state for additional features."]
33895 #[doc = ""]
33896 #[doc = "ID: 245"]
33897 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33898 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33899 #[doc = ""]
33900 #[doc = "ID: 162"]
33901 FENCE_STATUS(FENCE_STATUS_DATA),
33902 #[doc = "Vehicle status report that is sent out while figure eight execution is in progress (see MAV_CMD_DO_FIGURE_EIGHT). This may typically send at low rates: of the order of 2Hz."]
33903 #[doc = ""]
33904 #[doc = "ID: 361"]
33905 FIGURE_EIGHT_EXECUTION_STATUS(FIGURE_EIGHT_EXECUTION_STATUS_DATA),
33906 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33907 #[doc = ""]
33908 #[doc = "ID: 110"]
33909 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33910 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33911 #[doc = ""]
33912 #[doc = "ID: 264"]
33913 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33914 #[doc = "Current motion information from a designated system."]
33915 #[doc = ""]
33916 #[doc = "ID: 144"]
33917 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33918 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33919 #[doc = ""]
33920 #[doc = "ID: 371"]
33921 FUEL_STATUS(FUEL_STATUS_DATA),
33922 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33923 #[doc = ""]
33924 #[doc = "ID: 373"]
33925 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33926 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33927 #[doc = ""]
33928 #[doc = "ID: 285"]
33929 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33930 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33931 #[doc = ""]
33932 #[doc = "ID: 283"]
33933 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33934 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33935 #[doc = ""]
33936 #[doc = "ID: 284"]
33937 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33938 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33939 #[doc = ""]
33940 #[doc = "ID: 280"]
33941 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33942 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33943 #[doc = ""]
33944 #[doc = "ID: 282"]
33945 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33946 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33947 #[doc = ""]
33948 #[doc = "ID: 288"]
33949 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33950 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33951 #[doc = ""]
33952 #[doc = "ID: 287"]
33953 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33954 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33955 #[doc = ""]
33956 #[doc = "ID: 281"]
33957 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33958 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33959 #[doc = ""]
33960 #[doc = "ID: 33"]
33961 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33962 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33963 #[doc = ""]
33964 #[doc = "ID: 63"]
33965 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33966 #[doc = "Global position/attitude estimate from a vision source."]
33967 #[doc = ""]
33968 #[doc = "ID: 101"]
33969 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33970 #[doc = "Information about key components of GNSS receivers, like signal authentication, interference and system errors."]
33971 #[doc = ""]
33972 #[doc = "ID: 441"]
33973 GNSS_INTEGRITY(GNSS_INTEGRITY_DATA),
33974 #[doc = "Second GPS data."]
33975 #[doc = ""]
33976 #[doc = "ID: 124"]
33977 GPS2_RAW(GPS2_RAW_DATA),
33978 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33979 #[doc = ""]
33980 #[doc = "ID: 128"]
33981 GPS2_RTK(GPS2_RTK_DATA),
33982 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33983 #[doc = ""]
33984 #[doc = "ID: 49"]
33985 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33986 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33987 #[doc = ""]
33988 #[doc = "ID: 123"]
33989 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33990 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33991 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33992 #[doc = ""]
33993 #[doc = "ID: 232"]
33994 GPS_INPUT(GPS_INPUT_DATA),
33995 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33996 #[doc = ""]
33997 #[doc = "ID: 24"]
33998 GPS_RAW_INT(GPS_RAW_INT_DATA),
33999 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
34000 #[doc = ""]
34001 #[doc = "ID: 233"]
34002 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
34003 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
34004 #[doc = ""]
34005 #[doc = "ID: 127"]
34006 GPS_RTK(GPS_RTK_DATA),
34007 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
34008 #[doc = ""]
34009 #[doc = "ID: 25"]
34010 GPS_STATUS(GPS_STATUS_DATA),
34011 #[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_END."]
34012 #[doc = ""]
34013 #[doc = "ID: 415"]
34014 GROUP_END(GROUP_END_DATA),
34015 #[doc = "Emitted during mission execution when control reaches MAV_CMD_GROUP_START."]
34016 #[doc = ""]
34017 #[doc = "ID: 414"]
34018 GROUP_START(GROUP_START_DATA),
34019 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
34020 #[doc = ""]
34021 #[doc = "ID: 0"]
34022 HEARTBEAT(HEARTBEAT_DATA),
34023 #[doc = "The IMU readings in SI units in NED body frame."]
34024 #[doc = ""]
34025 #[doc = "ID: 105"]
34026 HIGHRES_IMU(HIGHRES_IMU_DATA),
34027 #[doc = "Message appropriate for high latency connections like Iridium."]
34028 #[doc = ""]
34029 #[doc = "ID: 234"]
34030 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
34031 HIGH_LATENCY(HIGH_LATENCY_DATA),
34032 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
34033 #[doc = ""]
34034 #[doc = "ID: 235"]
34035 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
34036 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
34037 #[doc = ""]
34038 #[doc = "ID: 93"]
34039 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
34040 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
34041 #[doc = ""]
34042 #[doc = "ID: 91"]
34043 HIL_CONTROLS(HIL_CONTROLS_DATA),
34044 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
34045 #[doc = ""]
34046 #[doc = "ID: 113"]
34047 HIL_GPS(HIL_GPS_DATA),
34048 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
34049 #[doc = ""]
34050 #[doc = "ID: 114"]
34051 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
34052 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
34053 #[doc = ""]
34054 #[doc = "ID: 92"]
34055 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
34056 #[doc = "The IMU readings in SI units in NED body frame."]
34057 #[doc = ""]
34058 #[doc = "ID: 107"]
34059 HIL_SENSOR(HIL_SENSOR_DATA),
34060 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34061 #[doc = ""]
34062 #[doc = "ID: 90"]
34063 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
34064 HIL_STATE(HIL_STATE_DATA),
34065 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
34066 #[doc = ""]
34067 #[doc = "ID: 115"]
34068 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
34069 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
34070 #[doc = ""]
34071 #[doc = "ID: 242"]
34072 HOME_POSITION(HOME_POSITION_DATA),
34073 #[doc = "Temperature and humidity from hygrometer."]
34074 #[doc = ""]
34075 #[doc = "ID: 12920"]
34076 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
34077 #[doc = "Illuminator status."]
34078 #[doc = ""]
34079 #[doc = "ID: 440"]
34080 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
34081 #[doc = "Status of the Iridium SBD link."]
34082 #[doc = ""]
34083 #[doc = "ID: 335"]
34084 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
34085 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
34086 #[doc = ""]
34087 #[doc = "ID: 149"]
34088 LANDING_TARGET(LANDING_TARGET_DATA),
34089 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
34090 #[doc = ""]
34091 #[doc = "ID: 8"]
34092 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
34093 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34094 #[doc = ""]
34095 #[doc = "ID: 32"]
34096 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
34097 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34098 #[doc = ""]
34099 #[doc = "ID: 64"]
34100 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
34101 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
34102 #[doc = ""]
34103 #[doc = "ID: 89"]
34104 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
34105 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
34106 #[doc = ""]
34107 #[doc = "ID: 268"]
34108 LOGGING_ACK(LOGGING_ACK_DATA),
34109 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
34110 #[doc = ""]
34111 #[doc = "ID: 266"]
34112 LOGGING_DATA(LOGGING_DATA_DATA),
34113 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
34114 #[doc = ""]
34115 #[doc = "ID: 267"]
34116 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
34117 #[doc = "Reply to LOG_REQUEST_DATA."]
34118 #[doc = ""]
34119 #[doc = "ID: 120"]
34120 LOG_DATA(LOG_DATA_DATA),
34121 #[doc = "Reply to LOG_REQUEST_LIST."]
34122 #[doc = ""]
34123 #[doc = "ID: 118"]
34124 LOG_ENTRY(LOG_ENTRY_DATA),
34125 #[doc = "Erase all logs."]
34126 #[doc = ""]
34127 #[doc = "ID: 121"]
34128 LOG_ERASE(LOG_ERASE_DATA),
34129 #[doc = "Request a chunk of a log."]
34130 #[doc = ""]
34131 #[doc = "ID: 119"]
34132 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
34133 #[doc = "Stop log transfer and resume normal logging."]
34134 #[doc = ""]
34135 #[doc = "ID: 122"]
34136 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
34137 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
34138 #[doc = ""]
34139 #[doc = "ID: 117"]
34140 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
34141 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
34142 #[doc = ""]
34143 #[doc = "ID: 192"]
34144 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
34145 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
34146 #[doc = ""]
34147 #[doc = "ID: 69"]
34148 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
34149 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
34150 #[doc = ""]
34151 #[doc = "ID: 81"]
34152 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
34153 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34154 #[doc = ""]
34155 #[doc = "ID: 249"]
34156 MEMORY_VECT(MEMORY_VECT_DATA),
34157 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
34158 #[doc = ""]
34159 #[doc = "ID: 244"]
34160 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
34161 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
34162 #[doc = ""]
34163 #[doc = "ID: 47"]
34164 MISSION_ACK(MISSION_ACK_DATA),
34165 #[doc = "Delete all mission items at once."]
34166 #[doc = ""]
34167 #[doc = "ID: 45"]
34168 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
34169 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
34170 #[doc = ""]
34171 #[doc = "ID: 44"]
34172 MISSION_COUNT(MISSION_COUNT_DATA),
34173 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
34174 #[doc = ""]
34175 #[doc = "ID: 42"]
34176 MISSION_CURRENT(MISSION_CURRENT_DATA),
34177 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34178 #[doc = ""]
34179 #[doc = "ID: 39"]
34180 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
34181 MISSION_ITEM(MISSION_ITEM_DATA),
34182 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
34183 #[doc = ""]
34184 #[doc = "ID: 73"]
34185 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
34186 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
34187 #[doc = ""]
34188 #[doc = "ID: 46"]
34189 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
34190 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
34191 #[doc = ""]
34192 #[doc = "ID: 40"]
34193 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
34194 MISSION_REQUEST(MISSION_REQUEST_DATA),
34195 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
34196 #[doc = ""]
34197 #[doc = "ID: 51"]
34198 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
34199 #[doc = "Request the overall list of mission items from the system/component."]
34200 #[doc = ""]
34201 #[doc = "ID: 43"]
34202 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
34203 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
34204 #[doc = ""]
34205 #[doc = "ID: 37"]
34206 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
34207 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
34208 #[doc = ""]
34209 #[doc = "ID: 41"]
34210 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
34211 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
34212 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
34213 #[doc = ""]
34214 #[doc = "ID: 38"]
34215 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
34216 #[doc = "Orientation of a mount."]
34217 #[doc = ""]
34218 #[doc = "ID: 265"]
34219 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
34220 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
34221 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34222 #[doc = ""]
34223 #[doc = "ID: 251"]
34224 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
34225 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
34226 #[doc = ""]
34227 #[doc = "ID: 252"]
34228 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
34229 #[doc = "The state of the navigation and position controller."]
34230 #[doc = ""]
34231 #[doc = "ID: 62"]
34232 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
34233 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
34234 #[doc = ""]
34235 #[doc = "ID: 330"]
34236 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
34237 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
34238 #[doc = ""]
34239 #[doc = "ID: 331"]
34240 ODOMETRY(ODOMETRY_DATA),
34241 #[doc = "Hardware status sent by an onboard computer."]
34242 #[doc = ""]
34243 #[doc = "ID: 390"]
34244 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
34245 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
34246 #[doc = ""]
34247 #[doc = "ID: 12918"]
34248 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
34249 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
34250 #[doc = ""]
34251 #[doc = "ID: 12902"]
34252 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
34253 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
34254 #[doc = ""]
34255 #[doc = "ID: 12900"]
34256 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
34257 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
34258 #[doc = ""]
34259 #[doc = "ID: 12901"]
34260 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
34261 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
34262 #[doc = ""]
34263 #[doc = "ID: 12915"]
34264 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
34265 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
34266 #[doc = ""]
34267 #[doc = "ID: 12905"]
34268 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
34269 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
34270 #[doc = ""]
34271 #[doc = "ID: 12903"]
34272 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
34273 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
34274 #[doc = ""]
34275 #[doc = "ID: 12904"]
34276 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
34277 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
34278 #[doc = ""]
34279 #[doc = "ID: 12919"]
34280 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
34281 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
34282 #[doc = ""]
34283 #[doc = "ID: 100"]
34284 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
34285 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
34286 #[doc = ""]
34287 #[doc = "ID: 106"]
34288 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
34289 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
34290 #[doc = ""]
34291 #[doc = "ID: 360"]
34292 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
34293 #[doc = "Response from a PARAM_EXT_SET message."]
34294 #[doc = ""]
34295 #[doc = "ID: 324"]
34296 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
34297 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
34298 #[doc = ""]
34299 #[doc = "ID: 321"]
34300 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
34301 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
34302 #[doc = ""]
34303 #[doc = "ID: 320"]
34304 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
34305 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
34306 #[doc = ""]
34307 #[doc = "ID: 323"]
34308 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
34309 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
34310 #[doc = ""]
34311 #[doc = "ID: 322"]
34312 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
34313 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
34314 #[doc = ""]
34315 #[doc = "ID: 50"]
34316 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
34317 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34318 #[doc = ""]
34319 #[doc = "ID: 21"]
34320 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
34321 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
34322 #[doc = ""]
34323 #[doc = "ID: 20"]
34324 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
34325 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34326 #[doc = ""]
34327 #[doc = "ID: 23"]
34328 PARAM_SET(PARAM_SET_DATA),
34329 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
34330 #[doc = ""]
34331 #[doc = "ID: 22"]
34332 PARAM_VALUE(PARAM_VALUE_DATA),
34333 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
34334 #[doc = ""]
34335 #[doc = "ID: 4"]
34336 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
34337 PING(PING_DATA),
34338 #[doc = "Control vehicle tone generation (buzzer)."]
34339 #[doc = ""]
34340 #[doc = "ID: 258"]
34341 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
34342 PLAY_TUNE(PLAY_TUNE_DATA),
34343 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
34344 #[doc = ""]
34345 #[doc = "ID: 400"]
34346 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
34347 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
34348 #[doc = ""]
34349 #[doc = "ID: 87"]
34350 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
34351 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
34352 #[doc = ""]
34353 #[doc = "ID: 85"]
34354 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
34355 #[doc = "Power supply status."]
34356 #[doc = ""]
34357 #[doc = "ID: 125"]
34358 POWER_STATUS(POWER_STATUS_DATA),
34359 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
34360 #[doc = ""]
34361 #[doc = "ID: 300"]
34362 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
34363 #[doc = "RC channel outputs from a MAVLink RC receiver for input to a flight controller or other components (allows an RC receiver to connect via MAVLink instead of some other protocol such as PPM-Sum or S.BUS). Note that this is not intended to be an over-the-air format, and does not replace RC_CHANNELS and similar messages reported by the flight controller. The target_system field should normally be set to the system id of the system to control, typically the flight controller. The target_component field can normally be set to 0, so that all components of the system can receive the message. The channels array field can publish up to 32 channels; the number of channel items used in the array is specified in the count field. The time_last_update_ms field contains the timestamp of the last received valid channels data in the receiver's time domain. The count field indicates the first index of the channel array that is not used for channel data (this and later indexes are zero-filled). The RADIO_RC_CHANNELS_FLAGS_OUTDATED flag is set by the receiver if the channels data is not up-to-date (for example, if new data from the transmitter could not be validated so the last valid data is resent). The RADIO_RC_CHANNELS_FLAGS_FAILSAFE failsafe flag is set by the receiver if the receiver's failsafe condition is met (implementation dependent, e.g., connection to the RC radio is lost). In this case time_last_update_ms still contains the timestamp of the last valid channels data, but the content of the channels data is not defined by the protocol (it is up to the implementation of the receiver). For instance, the channels data could contain failsafe values configured in the receiver; the default is to carry the last valid data. Note: The RC channels fields are extensions to ensure that they are located at the end of the serialized payload and subject to MAVLink's trailing-zero trimming."]
34364 #[doc = ""]
34365 #[doc = "ID: 420"]
34366 RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA),
34367 #[doc = "Status generated by radio and injected into MAVLink stream."]
34368 #[doc = ""]
34369 #[doc = "ID: 109"]
34370 RADIO_STATUS(RADIO_STATUS_DATA),
34371 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
34372 #[doc = ""]
34373 #[doc = "ID: 27"]
34374 RAW_IMU(RAW_IMU_DATA),
34375 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
34376 #[doc = ""]
34377 #[doc = "ID: 28"]
34378 RAW_PRESSURE(RAW_PRESSURE_DATA),
34379 #[doc = "RPM sensor data message."]
34380 #[doc = ""]
34381 #[doc = "ID: 339"]
34382 RAW_RPM(RAW_RPM_DATA),
34383 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34384 #[doc = ""]
34385 #[doc = "ID: 65"]
34386 RC_CHANNELS(RC_CHANNELS_DATA),
34387 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
34388 #[doc = ""]
34389 #[doc = "ID: 70"]
34390 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
34391 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
34392 #[doc = ""]
34393 #[doc = "ID: 35"]
34394 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
34395 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
34396 #[doc = ""]
34397 #[doc = "ID: 34"]
34398 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
34399 #[doc = "Request a data stream."]
34400 #[doc = ""]
34401 #[doc = "ID: 66"]
34402 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
34403 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
34404 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
34405 #[doc = ""]
34406 #[doc = "ID: 412"]
34407 REQUEST_EVENT(REQUEST_EVENT_DATA),
34408 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
34409 #[doc = ""]
34410 #[doc = "ID: 142"]
34411 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
34412 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
34413 #[doc = ""]
34414 #[doc = "ID: 413"]
34415 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
34416 #[doc = "Read out the safety zone the MAV currently assumes."]
34417 #[doc = ""]
34418 #[doc = "ID: 55"]
34419 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
34420 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
34421 #[doc = ""]
34422 #[doc = "ID: 54"]
34423 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
34424 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
34425 #[doc = ""]
34426 #[doc = "ID: 26"]
34427 SCALED_IMU(SCALED_IMU_DATA),
34428 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
34429 #[doc = ""]
34430 #[doc = "ID: 116"]
34431 SCALED_IMU2(SCALED_IMU2_DATA),
34432 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
34433 #[doc = ""]
34434 #[doc = "ID: 129"]
34435 SCALED_IMU3(SCALED_IMU3_DATA),
34436 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
34437 #[doc = ""]
34438 #[doc = "ID: 29"]
34439 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
34440 #[doc = "Barometer readings for 2nd barometer."]
34441 #[doc = ""]
34442 #[doc = "ID: 137"]
34443 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
34444 #[doc = "Barometer readings for 3rd barometer."]
34445 #[doc = ""]
34446 #[doc = "ID: 143"]
34447 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
34448 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
34449 #[doc = ""]
34450 #[doc = "ID: 126"]
34451 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
34452 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
34453 #[doc = ""]
34454 #[doc = "ID: 36"]
34455 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
34456 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
34457 #[doc = ""]
34458 #[doc = "ID: 256"]
34459 SETUP_SIGNING(SETUP_SIGNING_DATA),
34460 #[doc = "Set the vehicle attitude and body angular rates."]
34461 #[doc = ""]
34462 #[doc = "ID: 139"]
34463 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
34464 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
34465 #[doc = ""]
34466 #[doc = "ID: 82"]
34467 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
34468 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
34469 #[doc = ""]
34470 #[doc = "ID: 48"]
34471 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
34472 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
34473 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
34474 #[doc = ""]
34475 #[doc = "ID: 243"]
34476 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
34477 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
34478 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
34479 #[doc = ""]
34480 #[doc = "ID: 11"]
34481 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
34482 SET_MODE(SET_MODE_DATA),
34483 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
34484 #[doc = ""]
34485 #[doc = "ID: 86"]
34486 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
34487 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
34488 #[doc = ""]
34489 #[doc = "ID: 84"]
34490 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
34491 #[doc = "Set temporary maximum limits for horizontal speed, vertical speed and yaw rate. The consumer must stream the current limits in VELOCITY_LIMITS at 1 Hz or more (when limits are being set). The consumer should latch the limits until a new limit is received or the mode is changed."]
34492 #[doc = ""]
34493 #[doc = "ID: 354"]
34494 SET_VELOCITY_LIMITS(SET_VELOCITY_LIMITS_DATA),
34495 #[doc = "Status of simulation environment, if used."]
34496 #[doc = ""]
34497 #[doc = "ID: 108"]
34498 SIM_STATE(SIM_STATE_DATA),
34499 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
34500 #[doc = ""]
34501 #[doc = "ID: 370"]
34502 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
34503 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
34504 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
34505 #[doc = ""]
34506 #[doc = "ID: 253"]
34507 STATUSTEXT(STATUSTEXT_DATA),
34508 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
34509 #[doc = ""]
34510 #[doc = "ID: 261"]
34511 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
34512 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
34513 #[doc = ""]
34514 #[doc = "ID: 401"]
34515 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
34516 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
34517 #[doc = ""]
34518 #[doc = "ID: 2"]
34519 SYSTEM_TIME(SYSTEM_TIME_DATA),
34520 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
34521 #[doc = ""]
34522 #[doc = "ID: 1"]
34523 SYS_STATUS(SYS_STATUS_DATA),
34524 #[doc = "Current motion information from sensors on a target."]
34525 #[doc = ""]
34526 #[doc = "ID: 510"]
34527 TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA),
34528 #[doc = "The location of a target measured by MAV's onboard sensors."]
34529 #[doc = ""]
34530 #[doc = "ID: 511"]
34531 TARGET_RELATIVE(TARGET_RELATIVE_DATA),
34532 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
34533 #[doc = ""]
34534 #[doc = "ID: 135"]
34535 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
34536 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34537 #[doc = ""]
34538 #[doc = "ID: 134"]
34539 TERRAIN_DATA(TERRAIN_DATA_DATA),
34540 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34541 #[doc = ""]
34542 #[doc = "ID: 136"]
34543 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
34544 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34545 #[doc = ""]
34546 #[doc = "ID: 133"]
34547 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
34548 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
34549 #[doc = ""]
34550 #[doc = "ID: 111"]
34551 TIMESYNC(TIMESYNC_DATA),
34552 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
34553 #[doc = ""]
34554 #[doc = "ID: 380"]
34555 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
34556 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
34557 #[doc = ""]
34558 #[doc = "ID: 333"]
34559 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
34560 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
34561 #[doc = ""]
34562 #[doc = "ID: 332"]
34563 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
34564 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
34565 #[doc = ""]
34566 #[doc = "ID: 385"]
34567 TUNNEL(TUNNEL_DATA),
34568 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
34569 #[doc = ""]
34570 #[doc = "ID: 311"]
34571 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
34572 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
34573 #[doc = ""]
34574 #[doc = "ID: 310"]
34575 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
34576 #[doc = "The global position resulting from GPS and sensor fusion."]
34577 #[doc = ""]
34578 #[doc = "ID: 340"]
34579 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
34580 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
34581 #[doc = ""]
34582 #[doc = "ID: 248"]
34583 V2_EXTENSION(V2_EXTENSION_DATA),
34584 #[doc = "Current limits for horizontal speed, vertical speed and yaw rate, as set by SET_VELOCITY_LIMITS."]
34585 #[doc = ""]
34586 #[doc = "ID: 355"]
34587 VELOCITY_LIMITS(VELOCITY_LIMITS_DATA),
34588 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
34589 #[doc = ""]
34590 #[doc = "ID: 74"]
34591 VFR_HUD(VFR_HUD_DATA),
34592 #[doc = "Vibration levels and accelerometer clipping."]
34593 #[doc = ""]
34594 #[doc = "ID: 241"]
34595 VIBRATION(VIBRATION_DATA),
34596 #[doc = "Global position estimate from a Vicon motion system source."]
34597 #[doc = ""]
34598 #[doc = "ID: 104"]
34599 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
34600 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
34601 #[doc = ""]
34602 #[doc = "ID: 269"]
34603 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
34604 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
34605 #[doc = ""]
34606 #[doc = "ID: 270"]
34607 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
34608 #[doc = "Local position/attitude estimate from a vision source."]
34609 #[doc = ""]
34610 #[doc = "ID: 102"]
34611 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
34612 #[doc = "Speed estimate from a vision source."]
34613 #[doc = ""]
34614 #[doc = "ID: 103"]
34615 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
34616 #[doc = "Cumulative distance traveled for each reported wheel."]
34617 #[doc = ""]
34618 #[doc = "ID: 9000"]
34619 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
34620 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
34621 #[doc = ""]
34622 #[doc = "ID: 299"]
34623 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
34624 #[doc = "Winch status."]
34625 #[doc = ""]
34626 #[doc = "ID: 9005"]
34627 WINCH_STATUS(WINCH_STATUS_DATA),
34628 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
34629 #[doc = ""]
34630 #[doc = "ID: 231"]
34631 WIND_COV(WIND_COV_DATA),
34632}
34633impl MavMessage {
34634 pub const fn all_ids() -> &'static [u32] {
34635 &[
34636 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
34637 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
34638 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
34639 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
34640 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
34641 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
34642 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
34643 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
34644 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
34645 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
34646 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
34647 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
34648 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
34649 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
34650 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
34651 295u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32,
34652 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 354u32,
34653 355u32, 360u32, 361u32, 369u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
34654 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
34655 412u32, 413u32, 414u32, 415u32, 420u32, 435u32, 436u32, 437u32, 440u32, 441u32, 510u32,
34656 511u32, 512u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32,
34657 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
34658 ]
34659 }
34660 pub const fn all_messages() -> &'static [(&'static str, u32)] {
34661 &[
34662 (HEARTBEAT_DATA::NAME, HEARTBEAT_DATA::ID),
34663 (SYS_STATUS_DATA::NAME, SYS_STATUS_DATA::ID),
34664 (SYSTEM_TIME_DATA::NAME, SYSTEM_TIME_DATA::ID),
34665 (PING_DATA::NAME, PING_DATA::ID),
34666 (
34667 CHANGE_OPERATOR_CONTROL_DATA::NAME,
34668 CHANGE_OPERATOR_CONTROL_DATA::ID,
34669 ),
34670 (
34671 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34672 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34673 ),
34674 (AUTH_KEY_DATA::NAME, AUTH_KEY_DATA::ID),
34675 (LINK_NODE_STATUS_DATA::NAME, LINK_NODE_STATUS_DATA::ID),
34676 (SET_MODE_DATA::NAME, SET_MODE_DATA::ID),
34677 (PARAM_REQUEST_READ_DATA::NAME, PARAM_REQUEST_READ_DATA::ID),
34678 (PARAM_REQUEST_LIST_DATA::NAME, PARAM_REQUEST_LIST_DATA::ID),
34679 (PARAM_VALUE_DATA::NAME, PARAM_VALUE_DATA::ID),
34680 (PARAM_SET_DATA::NAME, PARAM_SET_DATA::ID),
34681 (GPS_RAW_INT_DATA::NAME, GPS_RAW_INT_DATA::ID),
34682 (GPS_STATUS_DATA::NAME, GPS_STATUS_DATA::ID),
34683 (SCALED_IMU_DATA::NAME, SCALED_IMU_DATA::ID),
34684 (RAW_IMU_DATA::NAME, RAW_IMU_DATA::ID),
34685 (RAW_PRESSURE_DATA::NAME, RAW_PRESSURE_DATA::ID),
34686 (SCALED_PRESSURE_DATA::NAME, SCALED_PRESSURE_DATA::ID),
34687 (ATTITUDE_DATA::NAME, ATTITUDE_DATA::ID),
34688 (ATTITUDE_QUATERNION_DATA::NAME, ATTITUDE_QUATERNION_DATA::ID),
34689 (LOCAL_POSITION_NED_DATA::NAME, LOCAL_POSITION_NED_DATA::ID),
34690 (GLOBAL_POSITION_INT_DATA::NAME, GLOBAL_POSITION_INT_DATA::ID),
34691 (RC_CHANNELS_SCALED_DATA::NAME, RC_CHANNELS_SCALED_DATA::ID),
34692 (RC_CHANNELS_RAW_DATA::NAME, RC_CHANNELS_RAW_DATA::ID),
34693 (SERVO_OUTPUT_RAW_DATA::NAME, SERVO_OUTPUT_RAW_DATA::ID),
34694 (
34695 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34696 MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34697 ),
34698 (
34699 MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34700 MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34701 ),
34702 (MISSION_ITEM_DATA::NAME, MISSION_ITEM_DATA::ID),
34703 (MISSION_REQUEST_DATA::NAME, MISSION_REQUEST_DATA::ID),
34704 (MISSION_SET_CURRENT_DATA::NAME, MISSION_SET_CURRENT_DATA::ID),
34705 (MISSION_CURRENT_DATA::NAME, MISSION_CURRENT_DATA::ID),
34706 (
34707 MISSION_REQUEST_LIST_DATA::NAME,
34708 MISSION_REQUEST_LIST_DATA::ID,
34709 ),
34710 (MISSION_COUNT_DATA::NAME, MISSION_COUNT_DATA::ID),
34711 (MISSION_CLEAR_ALL_DATA::NAME, MISSION_CLEAR_ALL_DATA::ID),
34712 (
34713 MISSION_ITEM_REACHED_DATA::NAME,
34714 MISSION_ITEM_REACHED_DATA::ID,
34715 ),
34716 (MISSION_ACK_DATA::NAME, MISSION_ACK_DATA::ID),
34717 (
34718 SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34719 SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34720 ),
34721 (GPS_GLOBAL_ORIGIN_DATA::NAME, GPS_GLOBAL_ORIGIN_DATA::ID),
34722 (PARAM_MAP_RC_DATA::NAME, PARAM_MAP_RC_DATA::ID),
34723 (MISSION_REQUEST_INT_DATA::NAME, MISSION_REQUEST_INT_DATA::ID),
34724 (
34725 SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34726 SAFETY_SET_ALLOWED_AREA_DATA::ID,
34727 ),
34728 (SAFETY_ALLOWED_AREA_DATA::NAME, SAFETY_ALLOWED_AREA_DATA::ID),
34729 (
34730 ATTITUDE_QUATERNION_COV_DATA::NAME,
34731 ATTITUDE_QUATERNION_COV_DATA::ID,
34732 ),
34733 (
34734 NAV_CONTROLLER_OUTPUT_DATA::NAME,
34735 NAV_CONTROLLER_OUTPUT_DATA::ID,
34736 ),
34737 (
34738 GLOBAL_POSITION_INT_COV_DATA::NAME,
34739 GLOBAL_POSITION_INT_COV_DATA::ID,
34740 ),
34741 (
34742 LOCAL_POSITION_NED_COV_DATA::NAME,
34743 LOCAL_POSITION_NED_COV_DATA::ID,
34744 ),
34745 (RC_CHANNELS_DATA::NAME, RC_CHANNELS_DATA::ID),
34746 (REQUEST_DATA_STREAM_DATA::NAME, REQUEST_DATA_STREAM_DATA::ID),
34747 (DATA_STREAM_DATA::NAME, DATA_STREAM_DATA::ID),
34748 (MANUAL_CONTROL_DATA::NAME, MANUAL_CONTROL_DATA::ID),
34749 (
34750 RC_CHANNELS_OVERRIDE_DATA::NAME,
34751 RC_CHANNELS_OVERRIDE_DATA::ID,
34752 ),
34753 (MISSION_ITEM_INT_DATA::NAME, MISSION_ITEM_INT_DATA::ID),
34754 (VFR_HUD_DATA::NAME, VFR_HUD_DATA::ID),
34755 (COMMAND_INT_DATA::NAME, COMMAND_INT_DATA::ID),
34756 (COMMAND_LONG_DATA::NAME, COMMAND_LONG_DATA::ID),
34757 (COMMAND_ACK_DATA::NAME, COMMAND_ACK_DATA::ID),
34758 (COMMAND_CANCEL_DATA::NAME, COMMAND_CANCEL_DATA::ID),
34759 (MANUAL_SETPOINT_DATA::NAME, MANUAL_SETPOINT_DATA::ID),
34760 (SET_ATTITUDE_TARGET_DATA::NAME, SET_ATTITUDE_TARGET_DATA::ID),
34761 (ATTITUDE_TARGET_DATA::NAME, ATTITUDE_TARGET_DATA::ID),
34762 (
34763 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34764 SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34765 ),
34766 (
34767 POSITION_TARGET_LOCAL_NED_DATA::NAME,
34768 POSITION_TARGET_LOCAL_NED_DATA::ID,
34769 ),
34770 (
34771 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34772 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34773 ),
34774 (
34775 POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34776 POSITION_TARGET_GLOBAL_INT_DATA::ID,
34777 ),
34778 (
34779 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME,
34780 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID,
34781 ),
34782 (HIL_STATE_DATA::NAME, HIL_STATE_DATA::ID),
34783 (HIL_CONTROLS_DATA::NAME, HIL_CONTROLS_DATA::ID),
34784 (HIL_RC_INPUTS_RAW_DATA::NAME, HIL_RC_INPUTS_RAW_DATA::ID),
34785 (
34786 HIL_ACTUATOR_CONTROLS_DATA::NAME,
34787 HIL_ACTUATOR_CONTROLS_DATA::ID,
34788 ),
34789 (OPTICAL_FLOW_DATA::NAME, OPTICAL_FLOW_DATA::ID),
34790 (
34791 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34792 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34793 ),
34794 (
34795 VISION_POSITION_ESTIMATE_DATA::NAME,
34796 VISION_POSITION_ESTIMATE_DATA::ID,
34797 ),
34798 (
34799 VISION_SPEED_ESTIMATE_DATA::NAME,
34800 VISION_SPEED_ESTIMATE_DATA::ID,
34801 ),
34802 (
34803 VICON_POSITION_ESTIMATE_DATA::NAME,
34804 VICON_POSITION_ESTIMATE_DATA::ID,
34805 ),
34806 (HIGHRES_IMU_DATA::NAME, HIGHRES_IMU_DATA::ID),
34807 (OPTICAL_FLOW_RAD_DATA::NAME, OPTICAL_FLOW_RAD_DATA::ID),
34808 (HIL_SENSOR_DATA::NAME, HIL_SENSOR_DATA::ID),
34809 (SIM_STATE_DATA::NAME, SIM_STATE_DATA::ID),
34810 (RADIO_STATUS_DATA::NAME, RADIO_STATUS_DATA::ID),
34811 (
34812 FILE_TRANSFER_PROTOCOL_DATA::NAME,
34813 FILE_TRANSFER_PROTOCOL_DATA::ID,
34814 ),
34815 (TIMESYNC_DATA::NAME, TIMESYNC_DATA::ID),
34816 (CAMERA_TRIGGER_DATA::NAME, CAMERA_TRIGGER_DATA::ID),
34817 (HIL_GPS_DATA::NAME, HIL_GPS_DATA::ID),
34818 (HIL_OPTICAL_FLOW_DATA::NAME, HIL_OPTICAL_FLOW_DATA::ID),
34819 (
34820 HIL_STATE_QUATERNION_DATA::NAME,
34821 HIL_STATE_QUATERNION_DATA::ID,
34822 ),
34823 (SCALED_IMU2_DATA::NAME, SCALED_IMU2_DATA::ID),
34824 (LOG_REQUEST_LIST_DATA::NAME, LOG_REQUEST_LIST_DATA::ID),
34825 (LOG_ENTRY_DATA::NAME, LOG_ENTRY_DATA::ID),
34826 (LOG_REQUEST_DATA_DATA::NAME, LOG_REQUEST_DATA_DATA::ID),
34827 (LOG_DATA_DATA::NAME, LOG_DATA_DATA::ID),
34828 (LOG_ERASE_DATA::NAME, LOG_ERASE_DATA::ID),
34829 (LOG_REQUEST_END_DATA::NAME, LOG_REQUEST_END_DATA::ID),
34830 (GPS_INJECT_DATA_DATA::NAME, GPS_INJECT_DATA_DATA::ID),
34831 (GPS2_RAW_DATA::NAME, GPS2_RAW_DATA::ID),
34832 (POWER_STATUS_DATA::NAME, POWER_STATUS_DATA::ID),
34833 (SERIAL_CONTROL_DATA::NAME, SERIAL_CONTROL_DATA::ID),
34834 (GPS_RTK_DATA::NAME, GPS_RTK_DATA::ID),
34835 (GPS2_RTK_DATA::NAME, GPS2_RTK_DATA::ID),
34836 (SCALED_IMU3_DATA::NAME, SCALED_IMU3_DATA::ID),
34837 (
34838 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34839 DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34840 ),
34841 (ENCAPSULATED_DATA_DATA::NAME, ENCAPSULATED_DATA_DATA::ID),
34842 (DISTANCE_SENSOR_DATA::NAME, DISTANCE_SENSOR_DATA::ID),
34843 (TERRAIN_REQUEST_DATA::NAME, TERRAIN_REQUEST_DATA::ID),
34844 (TERRAIN_DATA_DATA::NAME, TERRAIN_DATA_DATA::ID),
34845 (TERRAIN_CHECK_DATA::NAME, TERRAIN_CHECK_DATA::ID),
34846 (TERRAIN_REPORT_DATA::NAME, TERRAIN_REPORT_DATA::ID),
34847 (SCALED_PRESSURE2_DATA::NAME, SCALED_PRESSURE2_DATA::ID),
34848 (ATT_POS_MOCAP_DATA::NAME, ATT_POS_MOCAP_DATA::ID),
34849 (
34850 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34851 SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34852 ),
34853 (
34854 ACTUATOR_CONTROL_TARGET_DATA::NAME,
34855 ACTUATOR_CONTROL_TARGET_DATA::ID,
34856 ),
34857 (ALTITUDE_DATA::NAME, ALTITUDE_DATA::ID),
34858 (RESOURCE_REQUEST_DATA::NAME, RESOURCE_REQUEST_DATA::ID),
34859 (SCALED_PRESSURE3_DATA::NAME, SCALED_PRESSURE3_DATA::ID),
34860 (FOLLOW_TARGET_DATA::NAME, FOLLOW_TARGET_DATA::ID),
34861 (
34862 CONTROL_SYSTEM_STATE_DATA::NAME,
34863 CONTROL_SYSTEM_STATE_DATA::ID,
34864 ),
34865 (BATTERY_STATUS_DATA::NAME, BATTERY_STATUS_DATA::ID),
34866 (AUTOPILOT_VERSION_DATA::NAME, AUTOPILOT_VERSION_DATA::ID),
34867 (LANDING_TARGET_DATA::NAME, LANDING_TARGET_DATA::ID),
34868 (FENCE_STATUS_DATA::NAME, FENCE_STATUS_DATA::ID),
34869 (MAG_CAL_REPORT_DATA::NAME, MAG_CAL_REPORT_DATA::ID),
34870 (EFI_STATUS_DATA::NAME, EFI_STATUS_DATA::ID),
34871 (ESTIMATOR_STATUS_DATA::NAME, ESTIMATOR_STATUS_DATA::ID),
34872 (WIND_COV_DATA::NAME, WIND_COV_DATA::ID),
34873 (GPS_INPUT_DATA::NAME, GPS_INPUT_DATA::ID),
34874 (GPS_RTCM_DATA_DATA::NAME, GPS_RTCM_DATA_DATA::ID),
34875 (HIGH_LATENCY_DATA::NAME, HIGH_LATENCY_DATA::ID),
34876 (HIGH_LATENCY2_DATA::NAME, HIGH_LATENCY2_DATA::ID),
34877 (VIBRATION_DATA::NAME, VIBRATION_DATA::ID),
34878 (HOME_POSITION_DATA::NAME, HOME_POSITION_DATA::ID),
34879 (SET_HOME_POSITION_DATA::NAME, SET_HOME_POSITION_DATA::ID),
34880 (MESSAGE_INTERVAL_DATA::NAME, MESSAGE_INTERVAL_DATA::ID),
34881 (EXTENDED_SYS_STATE_DATA::NAME, EXTENDED_SYS_STATE_DATA::ID),
34882 (ADSB_VEHICLE_DATA::NAME, ADSB_VEHICLE_DATA::ID),
34883 (COLLISION_DATA::NAME, COLLISION_DATA::ID),
34884 (V2_EXTENSION_DATA::NAME, V2_EXTENSION_DATA::ID),
34885 (MEMORY_VECT_DATA::NAME, MEMORY_VECT_DATA::ID),
34886 (DEBUG_VECT_DATA::NAME, DEBUG_VECT_DATA::ID),
34887 (NAMED_VALUE_FLOAT_DATA::NAME, NAMED_VALUE_FLOAT_DATA::ID),
34888 (NAMED_VALUE_INT_DATA::NAME, NAMED_VALUE_INT_DATA::ID),
34889 (STATUSTEXT_DATA::NAME, STATUSTEXT_DATA::ID),
34890 (DEBUG_DATA::NAME, DEBUG_DATA::ID),
34891 (SETUP_SIGNING_DATA::NAME, SETUP_SIGNING_DATA::ID),
34892 (BUTTON_CHANGE_DATA::NAME, BUTTON_CHANGE_DATA::ID),
34893 (PLAY_TUNE_DATA::NAME, PLAY_TUNE_DATA::ID),
34894 (CAMERA_INFORMATION_DATA::NAME, CAMERA_INFORMATION_DATA::ID),
34895 (CAMERA_SETTINGS_DATA::NAME, CAMERA_SETTINGS_DATA::ID),
34896 (STORAGE_INFORMATION_DATA::NAME, STORAGE_INFORMATION_DATA::ID),
34897 (
34898 CAMERA_CAPTURE_STATUS_DATA::NAME,
34899 CAMERA_CAPTURE_STATUS_DATA::ID,
34900 ),
34901 (
34902 CAMERA_IMAGE_CAPTURED_DATA::NAME,
34903 CAMERA_IMAGE_CAPTURED_DATA::ID,
34904 ),
34905 (FLIGHT_INFORMATION_DATA::NAME, FLIGHT_INFORMATION_DATA::ID),
34906 (MOUNT_ORIENTATION_DATA::NAME, MOUNT_ORIENTATION_DATA::ID),
34907 (LOGGING_DATA_DATA::NAME, LOGGING_DATA_DATA::ID),
34908 (LOGGING_DATA_ACKED_DATA::NAME, LOGGING_DATA_ACKED_DATA::ID),
34909 (LOGGING_ACK_DATA::NAME, LOGGING_ACK_DATA::ID),
34910 (
34911 VIDEO_STREAM_INFORMATION_DATA::NAME,
34912 VIDEO_STREAM_INFORMATION_DATA::ID,
34913 ),
34914 (VIDEO_STREAM_STATUS_DATA::NAME, VIDEO_STREAM_STATUS_DATA::ID),
34915 (CAMERA_FOV_STATUS_DATA::NAME, CAMERA_FOV_STATUS_DATA::ID),
34916 (
34917 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34918 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34919 ),
34920 (
34921 CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34922 CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34923 ),
34924 (
34925 CAMERA_THERMAL_RANGE_DATA::NAME,
34926 CAMERA_THERMAL_RANGE_DATA::ID,
34927 ),
34928 (
34929 GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34930 GIMBAL_MANAGER_INFORMATION_DATA::ID,
34931 ),
34932 (
34933 GIMBAL_MANAGER_STATUS_DATA::NAME,
34934 GIMBAL_MANAGER_STATUS_DATA::ID,
34935 ),
34936 (
34937 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34938 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34939 ),
34940 (
34941 GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34942 GIMBAL_DEVICE_INFORMATION_DATA::ID,
34943 ),
34944 (
34945 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34946 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34947 ),
34948 (
34949 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34950 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34951 ),
34952 (
34953 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME,
34954 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID,
34955 ),
34956 (
34957 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34958 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34959 ),
34960 (
34961 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME,
34962 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID,
34963 ),
34964 (ESC_INFO_DATA::NAME, ESC_INFO_DATA::ID),
34965 (ESC_STATUS_DATA::NAME, ESC_STATUS_DATA::ID),
34966 (AIRSPEED_DATA::NAME, AIRSPEED_DATA::ID),
34967 (WIFI_CONFIG_AP_DATA::NAME, WIFI_CONFIG_AP_DATA::ID),
34968 (PROTOCOL_VERSION_DATA::NAME, PROTOCOL_VERSION_DATA::ID),
34969 (AIS_VESSEL_DATA::NAME, AIS_VESSEL_DATA::ID),
34970 (UAVCAN_NODE_STATUS_DATA::NAME, UAVCAN_NODE_STATUS_DATA::ID),
34971 (UAVCAN_NODE_INFO_DATA::NAME, UAVCAN_NODE_INFO_DATA::ID),
34972 (
34973 PARAM_EXT_REQUEST_READ_DATA::NAME,
34974 PARAM_EXT_REQUEST_READ_DATA::ID,
34975 ),
34976 (
34977 PARAM_EXT_REQUEST_LIST_DATA::NAME,
34978 PARAM_EXT_REQUEST_LIST_DATA::ID,
34979 ),
34980 (PARAM_EXT_VALUE_DATA::NAME, PARAM_EXT_VALUE_DATA::ID),
34981 (PARAM_EXT_SET_DATA::NAME, PARAM_EXT_SET_DATA::ID),
34982 (PARAM_EXT_ACK_DATA::NAME, PARAM_EXT_ACK_DATA::ID),
34983 (OBSTACLE_DISTANCE_DATA::NAME, OBSTACLE_DISTANCE_DATA::ID),
34984 (ODOMETRY_DATA::NAME, ODOMETRY_DATA::ID),
34985 (
34986 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME,
34987 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID,
34988 ),
34989 (
34990 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME,
34991 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34992 ),
34993 (CELLULAR_STATUS_DATA::NAME, CELLULAR_STATUS_DATA::ID),
34994 (ISBD_LINK_STATUS_DATA::NAME, ISBD_LINK_STATUS_DATA::ID),
34995 (CELLULAR_CONFIG_DATA::NAME, CELLULAR_CONFIG_DATA::ID),
34996 (RAW_RPM_DATA::NAME, RAW_RPM_DATA::ID),
34997 (UTM_GLOBAL_POSITION_DATA::NAME, UTM_GLOBAL_POSITION_DATA::ID),
34998 (DEBUG_FLOAT_ARRAY_DATA::NAME, DEBUG_FLOAT_ARRAY_DATA::ID),
34999 (SET_VELOCITY_LIMITS_DATA::NAME, SET_VELOCITY_LIMITS_DATA::ID),
35000 (VELOCITY_LIMITS_DATA::NAME, VELOCITY_LIMITS_DATA::ID),
35001 (
35002 ORBIT_EXECUTION_STATUS_DATA::NAME,
35003 ORBIT_EXECUTION_STATUS_DATA::ID,
35004 ),
35005 (
35006 FIGURE_EIGHT_EXECUTION_STATUS_DATA::NAME,
35007 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID,
35008 ),
35009 (BATTERY_STATUS_V2_DATA::NAME, BATTERY_STATUS_V2_DATA::ID),
35010 (SMART_BATTERY_INFO_DATA::NAME, SMART_BATTERY_INFO_DATA::ID),
35011 (FUEL_STATUS_DATA::NAME, FUEL_STATUS_DATA::ID),
35012 (BATTERY_INFO_DATA::NAME, BATTERY_INFO_DATA::ID),
35013 (GENERATOR_STATUS_DATA::NAME, GENERATOR_STATUS_DATA::ID),
35014 (
35015 ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35016 ACTUATOR_OUTPUT_STATUS_DATA::ID,
35017 ),
35018 (
35019 TIME_ESTIMATE_TO_TARGET_DATA::NAME,
35020 TIME_ESTIMATE_TO_TARGET_DATA::ID,
35021 ),
35022 (TUNNEL_DATA::NAME, TUNNEL_DATA::ID),
35023 (CAN_FRAME_DATA::NAME, CAN_FRAME_DATA::ID),
35024 (CANFD_FRAME_DATA::NAME, CANFD_FRAME_DATA::ID),
35025 (CAN_FILTER_MODIFY_DATA::NAME, CAN_FILTER_MODIFY_DATA::ID),
35026 (
35027 ONBOARD_COMPUTER_STATUS_DATA::NAME,
35028 ONBOARD_COMPUTER_STATUS_DATA::ID,
35029 ),
35030 (
35031 COMPONENT_INFORMATION_DATA::NAME,
35032 COMPONENT_INFORMATION_DATA::ID,
35033 ),
35034 (
35035 COMPONENT_INFORMATION_BASIC_DATA::NAME,
35036 COMPONENT_INFORMATION_BASIC_DATA::ID,
35037 ),
35038 (COMPONENT_METADATA_DATA::NAME, COMPONENT_METADATA_DATA::ID),
35039 (PLAY_TUNE_V2_DATA::NAME, PLAY_TUNE_V2_DATA::ID),
35040 (SUPPORTED_TUNES_DATA::NAME, SUPPORTED_TUNES_DATA::ID),
35041 (EVENT_DATA::NAME, EVENT_DATA::ID),
35042 (
35043 CURRENT_EVENT_SEQUENCE_DATA::NAME,
35044 CURRENT_EVENT_SEQUENCE_DATA::ID,
35045 ),
35046 (REQUEST_EVENT_DATA::NAME, REQUEST_EVENT_DATA::ID),
35047 (
35048 RESPONSE_EVENT_ERROR_DATA::NAME,
35049 RESPONSE_EVENT_ERROR_DATA::ID,
35050 ),
35051 (GROUP_START_DATA::NAME, GROUP_START_DATA::ID),
35052 (GROUP_END_DATA::NAME, GROUP_END_DATA::ID),
35053 (RADIO_RC_CHANNELS_DATA::NAME, RADIO_RC_CHANNELS_DATA::ID),
35054 (AVAILABLE_MODES_DATA::NAME, AVAILABLE_MODES_DATA::ID),
35055 (CURRENT_MODE_DATA::NAME, CURRENT_MODE_DATA::ID),
35056 (
35057 AVAILABLE_MODES_MONITOR_DATA::NAME,
35058 AVAILABLE_MODES_MONITOR_DATA::ID,
35059 ),
35060 (ILLUMINATOR_STATUS_DATA::NAME, ILLUMINATOR_STATUS_DATA::ID),
35061 (GNSS_INTEGRITY_DATA::NAME, GNSS_INTEGRITY_DATA::ID),
35062 (TARGET_ABSOLUTE_DATA::NAME, TARGET_ABSOLUTE_DATA::ID),
35063 (TARGET_RELATIVE_DATA::NAME, TARGET_RELATIVE_DATA::ID),
35064 (CONTROL_STATUS_DATA::NAME, CONTROL_STATUS_DATA::ID),
35065 (WHEEL_DISTANCE_DATA::NAME, WHEEL_DISTANCE_DATA::ID),
35066 (WINCH_STATUS_DATA::NAME, WINCH_STATUS_DATA::ID),
35067 (
35068 OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
35069 OPEN_DRONE_ID_BASIC_ID_DATA::ID,
35070 ),
35071 (
35072 OPEN_DRONE_ID_LOCATION_DATA::NAME,
35073 OPEN_DRONE_ID_LOCATION_DATA::ID,
35074 ),
35075 (
35076 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
35077 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
35078 ),
35079 (
35080 OPEN_DRONE_ID_SELF_ID_DATA::NAME,
35081 OPEN_DRONE_ID_SELF_ID_DATA::ID,
35082 ),
35083 (
35084 OPEN_DRONE_ID_SYSTEM_DATA::NAME,
35085 OPEN_DRONE_ID_SYSTEM_DATA::ID,
35086 ),
35087 (
35088 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
35089 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
35090 ),
35091 (
35092 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
35093 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
35094 ),
35095 (
35096 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
35097 OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
35098 ),
35099 (
35100 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
35101 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
35102 ),
35103 (HYGROMETER_SENSOR_DATA::NAME, HYGROMETER_SENSOR_DATA::ID),
35104 ]
35105 }
35106}
35107impl Message for MavMessage {
35108 fn parse(
35109 version: MavlinkVersion,
35110 id: u32,
35111 payload: &[u8],
35112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35113 match id {
35114 ACTUATOR_CONTROL_TARGET_DATA::ID => {
35115 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35116 .map(Self::ACTUATOR_CONTROL_TARGET)
35117 }
35118 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
35119 .map(Self::ACTUATOR_OUTPUT_STATUS),
35120 ADSB_VEHICLE_DATA::ID => {
35121 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
35122 }
35123 AIRSPEED_DATA::ID => AIRSPEED_DATA::deser(version, payload).map(Self::AIRSPEED),
35124 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
35125 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
35126 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
35127 ATTITUDE_QUATERNION_DATA::ID => {
35128 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
35129 }
35130 ATTITUDE_QUATERNION_COV_DATA::ID => {
35131 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
35132 .map(Self::ATTITUDE_QUATERNION_COV)
35133 }
35134 ATTITUDE_TARGET_DATA::ID => {
35135 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
35136 }
35137 ATT_POS_MOCAP_DATA::ID => {
35138 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
35139 }
35140 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
35141 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35142 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
35143 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
35144 }
35145 AUTOPILOT_VERSION_DATA::ID => {
35146 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
35147 }
35148 AVAILABLE_MODES_DATA::ID => {
35149 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
35150 }
35151 AVAILABLE_MODES_MONITOR_DATA::ID => {
35152 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
35153 .map(Self::AVAILABLE_MODES_MONITOR)
35154 }
35155 BATTERY_INFO_DATA::ID => {
35156 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
35157 }
35158 BATTERY_STATUS_DATA::ID => {
35159 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
35160 }
35161 BATTERY_STATUS_V2_DATA::ID => {
35162 BATTERY_STATUS_V2_DATA::deser(version, payload).map(Self::BATTERY_STATUS_V2)
35163 }
35164 BUTTON_CHANGE_DATA::ID => {
35165 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
35166 }
35167 CAMERA_CAPTURE_STATUS_DATA::ID => {
35168 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
35169 }
35170 CAMERA_FOV_STATUS_DATA::ID => {
35171 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
35172 }
35173 CAMERA_IMAGE_CAPTURED_DATA::ID => {
35174 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
35175 }
35176 CAMERA_INFORMATION_DATA::ID => {
35177 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
35178 }
35179 CAMERA_SETTINGS_DATA::ID => {
35180 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
35181 }
35182 CAMERA_THERMAL_RANGE_DATA::ID => {
35183 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
35184 }
35185 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
35186 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
35187 .map(Self::CAMERA_TRACKING_GEO_STATUS)
35188 }
35189 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
35190 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
35191 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
35192 }
35193 CAMERA_TRIGGER_DATA::ID => {
35194 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
35195 }
35196 CANFD_FRAME_DATA::ID => {
35197 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
35198 }
35199 CAN_FILTER_MODIFY_DATA::ID => {
35200 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
35201 }
35202 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
35203 CELLULAR_CONFIG_DATA::ID => {
35204 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
35205 }
35206 CELLULAR_STATUS_DATA::ID => {
35207 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
35208 }
35209 CHANGE_OPERATOR_CONTROL_DATA::ID => {
35210 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
35211 .map(Self::CHANGE_OPERATOR_CONTROL)
35212 }
35213 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
35214 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
35215 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
35216 }
35217 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
35218 COMMAND_ACK_DATA::ID => {
35219 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
35220 }
35221 COMMAND_CANCEL_DATA::ID => {
35222 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
35223 }
35224 COMMAND_INT_DATA::ID => {
35225 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
35226 }
35227 COMMAND_LONG_DATA::ID => {
35228 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
35229 }
35230 COMPONENT_INFORMATION_DATA::ID => {
35231 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
35232 }
35233 COMPONENT_INFORMATION_BASIC_DATA::ID => {
35234 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
35235 .map(Self::COMPONENT_INFORMATION_BASIC)
35236 }
35237 COMPONENT_METADATA_DATA::ID => {
35238 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
35239 }
35240 CONTROL_STATUS_DATA::ID => {
35241 CONTROL_STATUS_DATA::deser(version, payload).map(Self::CONTROL_STATUS)
35242 }
35243 CONTROL_SYSTEM_STATE_DATA::ID => {
35244 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
35245 }
35246 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
35247 .map(Self::CURRENT_EVENT_SEQUENCE),
35248 CURRENT_MODE_DATA::ID => {
35249 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
35250 }
35251 DATA_STREAM_DATA::ID => {
35252 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
35253 }
35254 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
35255 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
35256 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
35257 }
35258 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
35259 DEBUG_FLOAT_ARRAY_DATA::ID => {
35260 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
35261 }
35262 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
35263 DISTANCE_SENSOR_DATA::ID => {
35264 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
35265 }
35266 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
35267 ENCAPSULATED_DATA_DATA::ID => {
35268 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
35269 }
35270 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
35271 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
35272 ESTIMATOR_STATUS_DATA::ID => {
35273 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
35274 }
35275 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
35276 EXTENDED_SYS_STATE_DATA::ID => {
35277 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
35278 }
35279 FENCE_STATUS_DATA::ID => {
35280 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
35281 }
35282 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => {
35283 FIGURE_EIGHT_EXECUTION_STATUS_DATA::deser(version, payload)
35284 .map(Self::FIGURE_EIGHT_EXECUTION_STATUS)
35285 }
35286 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
35287 .map(Self::FILE_TRANSFER_PROTOCOL),
35288 FLIGHT_INFORMATION_DATA::ID => {
35289 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
35290 }
35291 FOLLOW_TARGET_DATA::ID => {
35292 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
35293 }
35294 FUEL_STATUS_DATA::ID => {
35295 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
35296 }
35297 GENERATOR_STATUS_DATA::ID => {
35298 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
35299 }
35300 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
35301 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
35302 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
35303 }
35304 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
35305 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
35306 .map(Self::GIMBAL_DEVICE_INFORMATION)
35307 }
35308 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
35309 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
35310 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
35311 }
35312 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
35313 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
35314 .map(Self::GIMBAL_MANAGER_INFORMATION)
35315 }
35316 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
35317 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
35318 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
35319 }
35320 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35321 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
35322 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
35323 }
35324 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
35325 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
35326 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
35327 }
35328 GIMBAL_MANAGER_STATUS_DATA::ID => {
35329 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
35330 }
35331 GLOBAL_POSITION_INT_DATA::ID => {
35332 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
35333 }
35334 GLOBAL_POSITION_INT_COV_DATA::ID => {
35335 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
35336 .map(Self::GLOBAL_POSITION_INT_COV)
35337 }
35338 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35339 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35340 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
35341 }
35342 GNSS_INTEGRITY_DATA::ID => {
35343 GNSS_INTEGRITY_DATA::deser(version, payload).map(Self::GNSS_INTEGRITY)
35344 }
35345 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
35346 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
35347 GPS_GLOBAL_ORIGIN_DATA::ID => {
35348 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
35349 }
35350 GPS_INJECT_DATA_DATA::ID => {
35351 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
35352 }
35353 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
35354 GPS_RAW_INT_DATA::ID => {
35355 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
35356 }
35357 GPS_RTCM_DATA_DATA::ID => {
35358 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
35359 }
35360 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
35361 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
35362 GROUP_END_DATA::ID => GROUP_END_DATA::deser(version, payload).map(Self::GROUP_END),
35363 GROUP_START_DATA::ID => {
35364 GROUP_START_DATA::deser(version, payload).map(Self::GROUP_START)
35365 }
35366 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
35367 HIGHRES_IMU_DATA::ID => {
35368 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
35369 }
35370 HIGH_LATENCY_DATA::ID => {
35371 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
35372 }
35373 HIGH_LATENCY2_DATA::ID => {
35374 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
35375 }
35376 HIL_ACTUATOR_CONTROLS_DATA::ID => {
35377 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
35378 }
35379 HIL_CONTROLS_DATA::ID => {
35380 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
35381 }
35382 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
35383 HIL_OPTICAL_FLOW_DATA::ID => {
35384 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
35385 }
35386 HIL_RC_INPUTS_RAW_DATA::ID => {
35387 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
35388 }
35389 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
35390 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
35391 HIL_STATE_QUATERNION_DATA::ID => {
35392 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
35393 }
35394 HOME_POSITION_DATA::ID => {
35395 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
35396 }
35397 HYGROMETER_SENSOR_DATA::ID => {
35398 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
35399 }
35400 ILLUMINATOR_STATUS_DATA::ID => {
35401 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
35402 }
35403 ISBD_LINK_STATUS_DATA::ID => {
35404 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
35405 }
35406 LANDING_TARGET_DATA::ID => {
35407 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
35408 }
35409 LINK_NODE_STATUS_DATA::ID => {
35410 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
35411 }
35412 LOCAL_POSITION_NED_DATA::ID => {
35413 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
35414 }
35415 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
35416 .map(Self::LOCAL_POSITION_NED_COV),
35417 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35418 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
35419 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
35420 }
35421 LOGGING_ACK_DATA::ID => {
35422 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
35423 }
35424 LOGGING_DATA_DATA::ID => {
35425 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
35426 }
35427 LOGGING_DATA_ACKED_DATA::ID => {
35428 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
35429 }
35430 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
35431 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
35432 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
35433 LOG_REQUEST_DATA_DATA::ID => {
35434 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
35435 }
35436 LOG_REQUEST_END_DATA::ID => {
35437 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
35438 }
35439 LOG_REQUEST_LIST_DATA::ID => {
35440 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
35441 }
35442 MAG_CAL_REPORT_DATA::ID => {
35443 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
35444 }
35445 MANUAL_CONTROL_DATA::ID => {
35446 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
35447 }
35448 MANUAL_SETPOINT_DATA::ID => {
35449 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
35450 }
35451 MEMORY_VECT_DATA::ID => {
35452 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
35453 }
35454 MESSAGE_INTERVAL_DATA::ID => {
35455 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
35456 }
35457 MISSION_ACK_DATA::ID => {
35458 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
35459 }
35460 MISSION_CLEAR_ALL_DATA::ID => {
35461 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
35462 }
35463 MISSION_COUNT_DATA::ID => {
35464 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
35465 }
35466 MISSION_CURRENT_DATA::ID => {
35467 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
35468 }
35469 MISSION_ITEM_DATA::ID => {
35470 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
35471 }
35472 MISSION_ITEM_INT_DATA::ID => {
35473 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
35474 }
35475 MISSION_ITEM_REACHED_DATA::ID => {
35476 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
35477 }
35478 MISSION_REQUEST_DATA::ID => {
35479 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
35480 }
35481 MISSION_REQUEST_INT_DATA::ID => {
35482 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
35483 }
35484 MISSION_REQUEST_LIST_DATA::ID => {
35485 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
35486 }
35487 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
35488 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
35489 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
35490 }
35491 MISSION_SET_CURRENT_DATA::ID => {
35492 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
35493 }
35494 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
35495 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
35496 .map(Self::MISSION_WRITE_PARTIAL_LIST)
35497 }
35498 MOUNT_ORIENTATION_DATA::ID => {
35499 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
35500 }
35501 NAMED_VALUE_FLOAT_DATA::ID => {
35502 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
35503 }
35504 NAMED_VALUE_INT_DATA::ID => {
35505 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
35506 }
35507 NAV_CONTROLLER_OUTPUT_DATA::ID => {
35508 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
35509 }
35510 OBSTACLE_DISTANCE_DATA::ID => {
35511 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
35512 }
35513 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
35514 ONBOARD_COMPUTER_STATUS_DATA::ID => {
35515 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
35516 .map(Self::ONBOARD_COMPUTER_STATUS)
35517 }
35518 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
35519 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
35520 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
35521 }
35522 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
35523 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
35524 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
35525 }
35526 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
35527 .map(Self::OPEN_DRONE_ID_BASIC_ID),
35528 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
35529 .map(Self::OPEN_DRONE_ID_LOCATION),
35530 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
35531 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
35532 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
35533 }
35534 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
35535 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
35536 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
35537 }
35538 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
35539 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
35540 }
35541 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
35542 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
35543 }
35544 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
35545 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
35546 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
35547 }
35548 OPTICAL_FLOW_DATA::ID => {
35549 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
35550 }
35551 OPTICAL_FLOW_RAD_DATA::ID => {
35552 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
35553 }
35554 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
35555 .map(Self::ORBIT_EXECUTION_STATUS),
35556 PARAM_EXT_ACK_DATA::ID => {
35557 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
35558 }
35559 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
35560 .map(Self::PARAM_EXT_REQUEST_LIST),
35561 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
35562 .map(Self::PARAM_EXT_REQUEST_READ),
35563 PARAM_EXT_SET_DATA::ID => {
35564 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
35565 }
35566 PARAM_EXT_VALUE_DATA::ID => {
35567 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
35568 }
35569 PARAM_MAP_RC_DATA::ID => {
35570 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
35571 }
35572 PARAM_REQUEST_LIST_DATA::ID => {
35573 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
35574 }
35575 PARAM_REQUEST_READ_DATA::ID => {
35576 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
35577 }
35578 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
35579 PARAM_VALUE_DATA::ID => {
35580 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
35581 }
35582 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
35583 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
35584 PLAY_TUNE_V2_DATA::ID => {
35585 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
35586 }
35587 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35588 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35589 .map(Self::POSITION_TARGET_GLOBAL_INT)
35590 }
35591 POSITION_TARGET_LOCAL_NED_DATA::ID => {
35592 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35593 .map(Self::POSITION_TARGET_LOCAL_NED)
35594 }
35595 POWER_STATUS_DATA::ID => {
35596 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
35597 }
35598 PROTOCOL_VERSION_DATA::ID => {
35599 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
35600 }
35601 RADIO_RC_CHANNELS_DATA::ID => {
35602 RADIO_RC_CHANNELS_DATA::deser(version, payload).map(Self::RADIO_RC_CHANNELS)
35603 }
35604 RADIO_STATUS_DATA::ID => {
35605 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
35606 }
35607 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
35608 RAW_PRESSURE_DATA::ID => {
35609 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
35610 }
35611 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
35612 RC_CHANNELS_DATA::ID => {
35613 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
35614 }
35615 RC_CHANNELS_OVERRIDE_DATA::ID => {
35616 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
35617 }
35618 RC_CHANNELS_RAW_DATA::ID => {
35619 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
35620 }
35621 RC_CHANNELS_SCALED_DATA::ID => {
35622 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
35623 }
35624 REQUEST_DATA_STREAM_DATA::ID => {
35625 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
35626 }
35627 REQUEST_EVENT_DATA::ID => {
35628 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
35629 }
35630 RESOURCE_REQUEST_DATA::ID => {
35631 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
35632 }
35633 RESPONSE_EVENT_ERROR_DATA::ID => {
35634 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
35635 }
35636 SAFETY_ALLOWED_AREA_DATA::ID => {
35637 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
35638 }
35639 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
35640 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
35641 .map(Self::SAFETY_SET_ALLOWED_AREA)
35642 }
35643 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
35644 SCALED_IMU2_DATA::ID => {
35645 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
35646 }
35647 SCALED_IMU3_DATA::ID => {
35648 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
35649 }
35650 SCALED_PRESSURE_DATA::ID => {
35651 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
35652 }
35653 SCALED_PRESSURE2_DATA::ID => {
35654 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
35655 }
35656 SCALED_PRESSURE3_DATA::ID => {
35657 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
35658 }
35659 SERIAL_CONTROL_DATA::ID => {
35660 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
35661 }
35662 SERVO_OUTPUT_RAW_DATA::ID => {
35663 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
35664 }
35665 SETUP_SIGNING_DATA::ID => {
35666 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
35667 }
35668 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
35669 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35670 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
35671 }
35672 SET_ATTITUDE_TARGET_DATA::ID => {
35673 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
35674 }
35675 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
35676 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
35677 }
35678 SET_HOME_POSITION_DATA::ID => {
35679 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
35680 }
35681 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
35682 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35683 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35684 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
35685 }
35686 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
35687 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35688 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
35689 }
35690 SET_VELOCITY_LIMITS_DATA::ID => {
35691 SET_VELOCITY_LIMITS_DATA::deser(version, payload).map(Self::SET_VELOCITY_LIMITS)
35692 }
35693 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
35694 SMART_BATTERY_INFO_DATA::ID => {
35695 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
35696 }
35697 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
35698 STORAGE_INFORMATION_DATA::ID => {
35699 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
35700 }
35701 SUPPORTED_TUNES_DATA::ID => {
35702 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
35703 }
35704 SYSTEM_TIME_DATA::ID => {
35705 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
35706 }
35707 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
35708 TARGET_ABSOLUTE_DATA::ID => {
35709 TARGET_ABSOLUTE_DATA::deser(version, payload).map(Self::TARGET_ABSOLUTE)
35710 }
35711 TARGET_RELATIVE_DATA::ID => {
35712 TARGET_RELATIVE_DATA::deser(version, payload).map(Self::TARGET_RELATIVE)
35713 }
35714 TERRAIN_CHECK_DATA::ID => {
35715 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
35716 }
35717 TERRAIN_DATA_DATA::ID => {
35718 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
35719 }
35720 TERRAIN_REPORT_DATA::ID => {
35721 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
35722 }
35723 TERRAIN_REQUEST_DATA::ID => {
35724 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
35725 }
35726 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
35727 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
35728 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
35729 .map(Self::TIME_ESTIMATE_TO_TARGET)
35730 }
35731 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35732 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
35733 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
35734 }
35735 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35736 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
35737 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
35738 }
35739 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
35740 UAVCAN_NODE_INFO_DATA::ID => {
35741 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
35742 }
35743 UAVCAN_NODE_STATUS_DATA::ID => {
35744 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
35745 }
35746 UTM_GLOBAL_POSITION_DATA::ID => {
35747 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
35748 }
35749 V2_EXTENSION_DATA::ID => {
35750 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
35751 }
35752 VELOCITY_LIMITS_DATA::ID => {
35753 VELOCITY_LIMITS_DATA::deser(version, payload).map(Self::VELOCITY_LIMITS)
35754 }
35755 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
35756 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
35757 VICON_POSITION_ESTIMATE_DATA::ID => {
35758 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
35759 .map(Self::VICON_POSITION_ESTIMATE)
35760 }
35761 VIDEO_STREAM_INFORMATION_DATA::ID => {
35762 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
35763 .map(Self::VIDEO_STREAM_INFORMATION)
35764 }
35765 VIDEO_STREAM_STATUS_DATA::ID => {
35766 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
35767 }
35768 VISION_POSITION_ESTIMATE_DATA::ID => {
35769 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35770 .map(Self::VISION_POSITION_ESTIMATE)
35771 }
35772 VISION_SPEED_ESTIMATE_DATA::ID => {
35773 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
35774 }
35775 WHEEL_DISTANCE_DATA::ID => {
35776 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
35777 }
35778 WIFI_CONFIG_AP_DATA::ID => {
35779 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
35780 }
35781 WINCH_STATUS_DATA::ID => {
35782 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
35783 }
35784 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
35785 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
35786 }
35787 }
35788 fn message_name(&self) -> &'static str {
35789 match self {
35790 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
35791 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35792 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
35793 Self::AIRSPEED(..) => AIRSPEED_DATA::NAME,
35794 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
35795 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
35796 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
35797 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
35798 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
35799 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
35800 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
35801 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
35802 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35803 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
35804 }
35805 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
35806 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
35807 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
35808 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
35809 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
35810 Self::BATTERY_STATUS_V2(..) => BATTERY_STATUS_V2_DATA::NAME,
35811 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
35812 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
35813 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
35814 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
35815 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
35816 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
35817 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
35818 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
35819 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
35820 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
35821 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
35822 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
35823 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
35824 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
35825 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
35826 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
35827 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
35828 Self::COLLISION(..) => COLLISION_DATA::NAME,
35829 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
35830 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
35831 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
35832 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
35833 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
35834 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
35835 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
35836 Self::CONTROL_STATUS(..) => CONTROL_STATUS_DATA::NAME,
35837 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
35838 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
35839 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
35840 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
35841 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
35842 Self::DEBUG(..) => DEBUG_DATA::NAME,
35843 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
35844 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
35845 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
35846 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
35847 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
35848 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
35849 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
35850 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
35851 Self::EVENT(..) => EVENT_DATA::NAME,
35852 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
35853 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
35854 Self::FIGURE_EIGHT_EXECUTION_STATUS(..) => FIGURE_EIGHT_EXECUTION_STATUS_DATA::NAME,
35855 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
35856 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
35857 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
35858 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
35859 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
35860 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
35861 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
35862 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
35863 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
35864 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
35865 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
35866 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
35867 }
35868 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
35869 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
35870 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
35871 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
35872 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
35873 Self::GNSS_INTEGRITY(..) => GNSS_INTEGRITY_DATA::NAME,
35874 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
35875 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
35876 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
35877 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
35878 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
35879 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
35880 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
35881 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
35882 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
35883 Self::GROUP_END(..) => GROUP_END_DATA::NAME,
35884 Self::GROUP_START(..) => GROUP_START_DATA::NAME,
35885 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
35886 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
35887 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
35888 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
35889 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
35890 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
35891 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
35892 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
35893 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
35894 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
35895 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
35896 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
35897 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
35898 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
35899 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
35900 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
35901 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
35902 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
35903 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
35904 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
35905 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
35906 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
35907 }
35908 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
35909 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
35910 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
35911 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
35912 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
35913 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
35914 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
35915 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
35916 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
35917 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
35918 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
35919 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
35920 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
35921 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
35922 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
35923 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
35924 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
35925 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
35926 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
35927 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
35928 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
35929 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
35930 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
35931 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
35932 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
35933 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
35934 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
35935 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
35936 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
35937 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
35938 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
35939 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
35940 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
35941 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
35942 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
35943 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
35944 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
35945 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
35946 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
35947 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
35948 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
35949 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
35950 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
35951 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
35952 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
35953 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
35954 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
35955 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
35956 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
35957 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
35958 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
35959 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
35960 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
35961 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
35962 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
35963 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
35964 Self::PING(..) => PING_DATA::NAME,
35965 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
35966 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
35967 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35968 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
35969 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
35970 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
35971 Self::RADIO_RC_CHANNELS(..) => RADIO_RC_CHANNELS_DATA::NAME,
35972 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
35973 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
35974 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
35975 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
35976 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
35977 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
35978 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
35979 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
35980 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
35981 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
35982 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
35983 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
35984 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
35985 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
35986 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
35987 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
35988 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
35989 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
35990 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
35991 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
35992 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
35993 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
35994 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
35995 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
35996 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
35997 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
35998 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
35999 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
36000 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
36001 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
36002 Self::SET_VELOCITY_LIMITS(..) => SET_VELOCITY_LIMITS_DATA::NAME,
36003 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
36004 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
36005 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
36006 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
36007 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
36008 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
36009 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
36010 Self::TARGET_ABSOLUTE(..) => TARGET_ABSOLUTE_DATA::NAME,
36011 Self::TARGET_RELATIVE(..) => TARGET_RELATIVE_DATA::NAME,
36012 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
36013 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
36014 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
36015 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
36016 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
36017 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
36018 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
36019 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
36020 }
36021 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36022 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
36023 }
36024 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
36025 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
36026 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
36027 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
36028 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
36029 Self::VELOCITY_LIMITS(..) => VELOCITY_LIMITS_DATA::NAME,
36030 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
36031 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
36032 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
36033 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
36034 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
36035 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
36036 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
36037 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
36038 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
36039 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
36040 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
36041 }
36042 }
36043 fn message_id(&self) -> u32 {
36044 match self {
36045 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
36046 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
36047 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
36048 Self::AIRSPEED(..) => AIRSPEED_DATA::ID,
36049 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
36050 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
36051 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
36052 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
36053 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
36054 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
36055 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
36056 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
36057 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
36058 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
36059 }
36060 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
36061 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
36062 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
36063 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
36064 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
36065 Self::BATTERY_STATUS_V2(..) => BATTERY_STATUS_V2_DATA::ID,
36066 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
36067 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
36068 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
36069 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
36070 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
36071 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
36072 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
36073 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
36074 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
36075 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
36076 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
36077 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
36078 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
36079 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
36080 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
36081 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
36082 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
36083 Self::COLLISION(..) => COLLISION_DATA::ID,
36084 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
36085 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
36086 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
36087 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
36088 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
36089 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
36090 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
36091 Self::CONTROL_STATUS(..) => CONTROL_STATUS_DATA::ID,
36092 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
36093 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
36094 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
36095 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
36096 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
36097 Self::DEBUG(..) => DEBUG_DATA::ID,
36098 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
36099 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
36100 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
36101 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
36102 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
36103 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
36104 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
36105 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
36106 Self::EVENT(..) => EVENT_DATA::ID,
36107 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
36108 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
36109 Self::FIGURE_EIGHT_EXECUTION_STATUS(..) => FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID,
36110 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
36111 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
36112 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
36113 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
36114 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
36115 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
36116 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
36117 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
36118 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
36119 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
36120 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
36121 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
36122 }
36123 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
36124 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
36125 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
36126 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
36127 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
36128 Self::GNSS_INTEGRITY(..) => GNSS_INTEGRITY_DATA::ID,
36129 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
36130 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
36131 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
36132 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
36133 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
36134 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
36135 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
36136 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
36137 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
36138 Self::GROUP_END(..) => GROUP_END_DATA::ID,
36139 Self::GROUP_START(..) => GROUP_START_DATA::ID,
36140 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
36141 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
36142 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
36143 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
36144 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
36145 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
36146 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
36147 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
36148 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
36149 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
36150 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
36151 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
36152 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
36153 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
36154 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
36155 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
36156 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
36157 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
36158 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
36159 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
36160 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
36161 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
36162 }
36163 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
36164 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
36165 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
36166 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
36167 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
36168 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
36169 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
36170 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
36171 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
36172 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
36173 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
36174 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
36175 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
36176 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
36177 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
36178 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
36179 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
36180 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
36181 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
36182 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
36183 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
36184 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
36185 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
36186 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
36187 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
36188 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
36189 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
36190 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
36191 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
36192 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
36193 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
36194 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
36195 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
36196 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
36197 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
36198 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
36199 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
36200 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
36201 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
36202 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
36203 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
36204 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
36205 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
36206 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
36207 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
36208 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
36209 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
36210 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
36211 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
36212 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
36213 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
36214 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
36215 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
36216 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
36217 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
36218 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
36219 Self::PING(..) => PING_DATA::ID,
36220 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
36221 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
36222 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
36223 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
36224 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
36225 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
36226 Self::RADIO_RC_CHANNELS(..) => RADIO_RC_CHANNELS_DATA::ID,
36227 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
36228 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
36229 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
36230 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
36231 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
36232 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
36233 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
36234 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
36235 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
36236 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
36237 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
36238 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
36239 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
36240 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
36241 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
36242 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
36243 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
36244 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
36245 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
36246 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
36247 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
36248 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
36249 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
36250 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
36251 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
36252 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
36253 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
36254 Self::SET_MODE(..) => SET_MODE_DATA::ID,
36255 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
36256 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
36257 Self::SET_VELOCITY_LIMITS(..) => SET_VELOCITY_LIMITS_DATA::ID,
36258 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
36259 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
36260 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
36261 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
36262 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
36263 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
36264 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
36265 Self::TARGET_ABSOLUTE(..) => TARGET_ABSOLUTE_DATA::ID,
36266 Self::TARGET_RELATIVE(..) => TARGET_RELATIVE_DATA::ID,
36267 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
36268 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
36269 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
36270 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
36271 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
36272 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
36273 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
36274 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
36275 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
36276 }
36277 Self::TUNNEL(..) => TUNNEL_DATA::ID,
36278 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
36279 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
36280 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
36281 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
36282 Self::VELOCITY_LIMITS(..) => VELOCITY_LIMITS_DATA::ID,
36283 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
36284 Self::VIBRATION(..) => VIBRATION_DATA::ID,
36285 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
36286 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
36287 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
36288 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
36289 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
36290 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
36291 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
36292 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
36293 Self::WIND_COV(..) => WIND_COV_DATA::ID,
36294 }
36295 }
36296 fn message_id_from_name(name: &str) -> Option<u32> {
36297 match name {
36298 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
36299 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
36300 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
36301 AIRSPEED_DATA::NAME => Some(AIRSPEED_DATA::ID),
36302 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
36303 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
36304 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
36305 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
36306 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
36307 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
36308 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
36309 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
36310 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
36311 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
36312 }
36313 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
36314 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
36315 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
36316 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
36317 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
36318 BATTERY_STATUS_V2_DATA::NAME => Some(BATTERY_STATUS_V2_DATA::ID),
36319 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
36320 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
36321 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
36322 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
36323 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
36324 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
36325 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
36326 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
36327 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
36328 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
36329 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
36330 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
36331 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
36332 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
36333 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
36334 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
36335 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
36336 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
36337 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
36338 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
36339 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
36340 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
36341 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
36342 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
36343 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
36344 CONTROL_STATUS_DATA::NAME => Some(CONTROL_STATUS_DATA::ID),
36345 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
36346 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
36347 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
36348 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
36349 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
36350 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
36351 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
36352 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
36353 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
36354 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
36355 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
36356 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
36357 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
36358 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
36359 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
36360 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
36361 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
36362 FIGURE_EIGHT_EXECUTION_STATUS_DATA::NAME => {
36363 Some(FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID)
36364 }
36365 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
36366 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
36367 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
36368 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
36369 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
36370 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
36371 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
36372 }
36373 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
36374 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
36375 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
36376 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
36377 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
36378 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
36379 }
36380 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
36381 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
36382 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
36383 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
36384 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
36385 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
36386 }
36387 GNSS_INTEGRITY_DATA::NAME => Some(GNSS_INTEGRITY_DATA::ID),
36388 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
36389 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
36390 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
36391 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
36392 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
36393 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
36394 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
36395 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
36396 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
36397 GROUP_END_DATA::NAME => Some(GROUP_END_DATA::ID),
36398 GROUP_START_DATA::NAME => Some(GROUP_START_DATA::ID),
36399 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
36400 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
36401 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
36402 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
36403 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
36404 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
36405 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
36406 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
36407 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
36408 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
36409 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
36410 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
36411 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
36412 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
36413 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
36414 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
36415 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
36416 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
36417 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
36418 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
36419 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
36420 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
36421 }
36422 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
36423 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
36424 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
36425 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
36426 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
36427 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
36428 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
36429 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
36430 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
36431 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
36432 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
36433 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
36434 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
36435 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
36436 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
36437 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
36438 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
36439 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
36440 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
36441 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
36442 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
36443 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
36444 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
36445 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
36446 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
36447 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
36448 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
36449 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
36450 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
36451 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
36452 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
36453 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
36454 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
36455 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
36456 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
36457 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
36458 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
36459 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
36460 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
36461 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
36462 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
36463 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
36464 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
36465 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
36466 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
36467 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
36468 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
36469 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
36470 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
36471 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
36472 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
36473 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
36474 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
36475 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
36476 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
36477 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
36478 PING_DATA::NAME => Some(PING_DATA::ID),
36479 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
36480 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
36481 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
36482 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
36483 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
36484 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
36485 RADIO_RC_CHANNELS_DATA::NAME => Some(RADIO_RC_CHANNELS_DATA::ID),
36486 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
36487 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
36488 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
36489 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
36490 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
36491 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
36492 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
36493 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
36494 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
36495 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
36496 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
36497 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
36498 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
36499 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
36500 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
36501 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
36502 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
36503 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
36504 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
36505 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
36506 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
36507 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
36508 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
36509 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
36510 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
36511 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
36512 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
36513 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
36514 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
36515 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
36516 }
36517 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
36518 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
36519 }
36520 SET_VELOCITY_LIMITS_DATA::NAME => Some(SET_VELOCITY_LIMITS_DATA::ID),
36521 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
36522 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
36523 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
36524 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
36525 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
36526 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
36527 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
36528 TARGET_ABSOLUTE_DATA::NAME => Some(TARGET_ABSOLUTE_DATA::ID),
36529 TARGET_RELATIVE_DATA::NAME => Some(TARGET_RELATIVE_DATA::ID),
36530 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
36531 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
36532 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
36533 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
36534 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
36535 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
36536 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
36537 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
36538 }
36539 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
36540 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
36541 }
36542 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
36543 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
36544 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
36545 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
36546 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
36547 VELOCITY_LIMITS_DATA::NAME => Some(VELOCITY_LIMITS_DATA::ID),
36548 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
36549 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
36550 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
36551 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
36552 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
36553 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
36554 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
36555 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
36556 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
36557 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
36558 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
36559 _ => None,
36560 }
36561 }
36562 fn default_message_from_id(id: u32) -> Option<Self> {
36563 match id {
36564 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
36565 ACTUATOR_CONTROL_TARGET_DATA::default(),
36566 )),
36567 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
36568 ACTUATOR_OUTPUT_STATUS_DATA::default(),
36569 )),
36570 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
36571 AIRSPEED_DATA::ID => Some(Self::AIRSPEED(AIRSPEED_DATA::default())),
36572 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
36573 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
36574 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
36575 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
36576 ATTITUDE_QUATERNION_DATA::default(),
36577 )),
36578 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
36579 ATTITUDE_QUATERNION_COV_DATA::default(),
36580 )),
36581 ATTITUDE_TARGET_DATA::ID => {
36582 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
36583 }
36584 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
36585 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
36586 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36587 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
36588 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
36589 ))
36590 }
36591 AUTOPILOT_VERSION_DATA::ID => {
36592 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
36593 }
36594 AVAILABLE_MODES_DATA::ID => {
36595 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
36596 }
36597 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
36598 AVAILABLE_MODES_MONITOR_DATA::default(),
36599 )),
36600 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
36601 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
36602 BATTERY_STATUS_V2_DATA::ID => {
36603 Some(Self::BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA::default()))
36604 }
36605 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
36606 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
36607 CAMERA_CAPTURE_STATUS_DATA::default(),
36608 )),
36609 CAMERA_FOV_STATUS_DATA::ID => {
36610 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
36611 }
36612 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
36613 CAMERA_IMAGE_CAPTURED_DATA::default(),
36614 )),
36615 CAMERA_INFORMATION_DATA::ID => {
36616 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
36617 }
36618 CAMERA_SETTINGS_DATA::ID => {
36619 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
36620 }
36621 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
36622 CAMERA_THERMAL_RANGE_DATA::default(),
36623 )),
36624 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
36625 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
36626 )),
36627 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
36628 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
36629 )),
36630 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
36631 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
36632 CAN_FILTER_MODIFY_DATA::ID => {
36633 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
36634 }
36635 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
36636 CELLULAR_CONFIG_DATA::ID => {
36637 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
36638 }
36639 CELLULAR_STATUS_DATA::ID => {
36640 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
36641 }
36642 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
36643 CHANGE_OPERATOR_CONTROL_DATA::default(),
36644 )),
36645 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
36646 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
36647 )),
36648 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
36649 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
36650 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
36651 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
36652 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
36653 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
36654 COMPONENT_INFORMATION_DATA::default(),
36655 )),
36656 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
36657 COMPONENT_INFORMATION_BASIC_DATA::default(),
36658 )),
36659 COMPONENT_METADATA_DATA::ID => {
36660 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
36661 }
36662 CONTROL_STATUS_DATA::ID => Some(Self::CONTROL_STATUS(CONTROL_STATUS_DATA::default())),
36663 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
36664 CONTROL_SYSTEM_STATE_DATA::default(),
36665 )),
36666 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
36667 CURRENT_EVENT_SEQUENCE_DATA::default(),
36668 )),
36669 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
36670 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
36671 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
36672 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
36673 )),
36674 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
36675 DEBUG_FLOAT_ARRAY_DATA::ID => {
36676 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
36677 }
36678 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
36679 DISTANCE_SENSOR_DATA::ID => {
36680 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
36681 }
36682 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
36683 ENCAPSULATED_DATA_DATA::ID => {
36684 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
36685 }
36686 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
36687 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
36688 ESTIMATOR_STATUS_DATA::ID => {
36689 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
36690 }
36691 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
36692 EXTENDED_SYS_STATE_DATA::ID => {
36693 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
36694 }
36695 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
36696 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => Some(Self::FIGURE_EIGHT_EXECUTION_STATUS(
36697 FIGURE_EIGHT_EXECUTION_STATUS_DATA::default(),
36698 )),
36699 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36700 FILE_TRANSFER_PROTOCOL_DATA::default(),
36701 )),
36702 FLIGHT_INFORMATION_DATA::ID => {
36703 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
36704 }
36705 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
36706 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
36707 GENERATOR_STATUS_DATA::ID => {
36708 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
36709 }
36710 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36711 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
36712 )),
36713 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36714 GIMBAL_DEVICE_INFORMATION_DATA::default(),
36715 )),
36716 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36717 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
36718 )),
36719 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36720 GIMBAL_MANAGER_INFORMATION_DATA::default(),
36721 )),
36722 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36723 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
36724 )),
36725 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36726 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36727 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
36728 ))
36729 }
36730 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36731 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
36732 )),
36733 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36734 GIMBAL_MANAGER_STATUS_DATA::default(),
36735 )),
36736 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36737 GLOBAL_POSITION_INT_DATA::default(),
36738 )),
36739 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36740 GLOBAL_POSITION_INT_COV_DATA::default(),
36741 )),
36742 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36743 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36744 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
36745 ))
36746 }
36747 GNSS_INTEGRITY_DATA::ID => Some(Self::GNSS_INTEGRITY(GNSS_INTEGRITY_DATA::default())),
36748 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
36749 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
36750 GPS_GLOBAL_ORIGIN_DATA::ID => {
36751 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
36752 }
36753 GPS_INJECT_DATA_DATA::ID => {
36754 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
36755 }
36756 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
36757 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
36758 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
36759 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
36760 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
36761 GROUP_END_DATA::ID => Some(Self::GROUP_END(GROUP_END_DATA::default())),
36762 GROUP_START_DATA::ID => Some(Self::GROUP_START(GROUP_START_DATA::default())),
36763 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
36764 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
36765 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
36766 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
36767 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36768 HIL_ACTUATOR_CONTROLS_DATA::default(),
36769 )),
36770 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
36771 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
36772 HIL_OPTICAL_FLOW_DATA::ID => {
36773 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
36774 }
36775 HIL_RC_INPUTS_RAW_DATA::ID => {
36776 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
36777 }
36778 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
36779 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
36780 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36781 HIL_STATE_QUATERNION_DATA::default(),
36782 )),
36783 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
36784 HYGROMETER_SENSOR_DATA::ID => {
36785 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
36786 }
36787 ILLUMINATOR_STATUS_DATA::ID => {
36788 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
36789 }
36790 ISBD_LINK_STATUS_DATA::ID => {
36791 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
36792 }
36793 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
36794 LINK_NODE_STATUS_DATA::ID => {
36795 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
36796 }
36797 LOCAL_POSITION_NED_DATA::ID => {
36798 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
36799 }
36800 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36801 LOCAL_POSITION_NED_COV_DATA::default(),
36802 )),
36803 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36804 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36805 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
36806 ))
36807 }
36808 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
36809 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
36810 LOGGING_DATA_ACKED_DATA::ID => {
36811 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
36812 }
36813 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
36814 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
36815 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
36816 LOG_REQUEST_DATA_DATA::ID => {
36817 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
36818 }
36819 LOG_REQUEST_END_DATA::ID => {
36820 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
36821 }
36822 LOG_REQUEST_LIST_DATA::ID => {
36823 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
36824 }
36825 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
36826 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
36827 MANUAL_SETPOINT_DATA::ID => {
36828 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
36829 }
36830 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
36831 MESSAGE_INTERVAL_DATA::ID => {
36832 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
36833 }
36834 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
36835 MISSION_CLEAR_ALL_DATA::ID => {
36836 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
36837 }
36838 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
36839 MISSION_CURRENT_DATA::ID => {
36840 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
36841 }
36842 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
36843 MISSION_ITEM_INT_DATA::ID => {
36844 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
36845 }
36846 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36847 MISSION_ITEM_REACHED_DATA::default(),
36848 )),
36849 MISSION_REQUEST_DATA::ID => {
36850 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
36851 }
36852 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36853 MISSION_REQUEST_INT_DATA::default(),
36854 )),
36855 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36856 MISSION_REQUEST_LIST_DATA::default(),
36857 )),
36858 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36859 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
36860 )),
36861 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36862 MISSION_SET_CURRENT_DATA::default(),
36863 )),
36864 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36865 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
36866 )),
36867 MOUNT_ORIENTATION_DATA::ID => {
36868 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
36869 }
36870 NAMED_VALUE_FLOAT_DATA::ID => {
36871 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
36872 }
36873 NAMED_VALUE_INT_DATA::ID => {
36874 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
36875 }
36876 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36877 NAV_CONTROLLER_OUTPUT_DATA::default(),
36878 )),
36879 OBSTACLE_DISTANCE_DATA::ID => {
36880 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
36881 }
36882 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
36883 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36884 ONBOARD_COMPUTER_STATUS_DATA::default(),
36885 )),
36886 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36887 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
36888 )),
36889 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36890 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
36891 )),
36892 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36893 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
36894 )),
36895 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36896 OPEN_DRONE_ID_LOCATION_DATA::default(),
36897 )),
36898 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36899 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
36900 )),
36901 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36902 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
36903 )),
36904 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36905 OPEN_DRONE_ID_SELF_ID_DATA::default(),
36906 )),
36907 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36908 OPEN_DRONE_ID_SYSTEM_DATA::default(),
36909 )),
36910 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36911 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
36912 )),
36913 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
36914 OPTICAL_FLOW_RAD_DATA::ID => {
36915 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
36916 }
36917 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36918 ORBIT_EXECUTION_STATUS_DATA::default(),
36919 )),
36920 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
36921 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36922 PARAM_EXT_REQUEST_LIST_DATA::default(),
36923 )),
36924 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36925 PARAM_EXT_REQUEST_READ_DATA::default(),
36926 )),
36927 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
36928 PARAM_EXT_VALUE_DATA::ID => {
36929 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
36930 }
36931 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
36932 PARAM_REQUEST_LIST_DATA::ID => {
36933 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
36934 }
36935 PARAM_REQUEST_READ_DATA::ID => {
36936 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
36937 }
36938 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
36939 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
36940 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
36941 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
36942 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
36943 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36944 POSITION_TARGET_GLOBAL_INT_DATA::default(),
36945 )),
36946 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36947 POSITION_TARGET_LOCAL_NED_DATA::default(),
36948 )),
36949 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
36950 PROTOCOL_VERSION_DATA::ID => {
36951 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
36952 }
36953 RADIO_RC_CHANNELS_DATA::ID => {
36954 Some(Self::RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA::default()))
36955 }
36956 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
36957 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
36958 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
36959 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
36960 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
36961 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36962 RC_CHANNELS_OVERRIDE_DATA::default(),
36963 )),
36964 RC_CHANNELS_RAW_DATA::ID => {
36965 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
36966 }
36967 RC_CHANNELS_SCALED_DATA::ID => {
36968 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
36969 }
36970 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36971 REQUEST_DATA_STREAM_DATA::default(),
36972 )),
36973 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
36974 RESOURCE_REQUEST_DATA::ID => {
36975 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
36976 }
36977 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36978 RESPONSE_EVENT_ERROR_DATA::default(),
36979 )),
36980 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36981 SAFETY_ALLOWED_AREA_DATA::default(),
36982 )),
36983 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36984 SAFETY_SET_ALLOWED_AREA_DATA::default(),
36985 )),
36986 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
36987 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
36988 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
36989 SCALED_PRESSURE_DATA::ID => {
36990 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
36991 }
36992 SCALED_PRESSURE2_DATA::ID => {
36993 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
36994 }
36995 SCALED_PRESSURE3_DATA::ID => {
36996 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
36997 }
36998 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
36999 SERVO_OUTPUT_RAW_DATA::ID => {
37000 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
37001 }
37002 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
37003 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37004 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
37005 )),
37006 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37007 SET_ATTITUDE_TARGET_DATA::default(),
37008 )),
37009 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37010 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
37011 )),
37012 SET_HOME_POSITION_DATA::ID => {
37013 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
37014 }
37015 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
37016 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37017 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
37018 )),
37019 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37020 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
37021 )),
37022 SET_VELOCITY_LIMITS_DATA::ID => Some(Self::SET_VELOCITY_LIMITS(
37023 SET_VELOCITY_LIMITS_DATA::default(),
37024 )),
37025 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
37026 SMART_BATTERY_INFO_DATA::ID => {
37027 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
37028 }
37029 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
37030 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37031 STORAGE_INFORMATION_DATA::default(),
37032 )),
37033 SUPPORTED_TUNES_DATA::ID => {
37034 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
37035 }
37036 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
37037 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
37038 TARGET_ABSOLUTE_DATA::ID => {
37039 Some(Self::TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA::default()))
37040 }
37041 TARGET_RELATIVE_DATA::ID => {
37042 Some(Self::TARGET_RELATIVE(TARGET_RELATIVE_DATA::default()))
37043 }
37044 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
37045 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
37046 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
37047 TERRAIN_REQUEST_DATA::ID => {
37048 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
37049 }
37050 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
37051 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37052 TIME_ESTIMATE_TO_TARGET_DATA::default(),
37053 )),
37054 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37055 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37056 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
37057 ))
37058 }
37059 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37060 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37061 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
37062 ))
37063 }
37064 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
37065 UAVCAN_NODE_INFO_DATA::ID => {
37066 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
37067 }
37068 UAVCAN_NODE_STATUS_DATA::ID => {
37069 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
37070 }
37071 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37072 UTM_GLOBAL_POSITION_DATA::default(),
37073 )),
37074 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
37075 VELOCITY_LIMITS_DATA::ID => {
37076 Some(Self::VELOCITY_LIMITS(VELOCITY_LIMITS_DATA::default()))
37077 }
37078 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
37079 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
37080 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37081 VICON_POSITION_ESTIMATE_DATA::default(),
37082 )),
37083 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37084 VIDEO_STREAM_INFORMATION_DATA::default(),
37085 )),
37086 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37087 VIDEO_STREAM_STATUS_DATA::default(),
37088 )),
37089 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37090 VISION_POSITION_ESTIMATE_DATA::default(),
37091 )),
37092 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37093 VISION_SPEED_ESTIMATE_DATA::default(),
37094 )),
37095 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
37096 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
37097 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
37098 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
37099 _ => None,
37100 }
37101 }
37102 #[cfg(feature = "arbitrary")]
37103 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
37104 match id {
37105 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
37106 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37107 )),
37108 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
37109 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
37110 )),
37111 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
37112 AIRSPEED_DATA::ID => Some(Self::AIRSPEED(AIRSPEED_DATA::random(rng))),
37113 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
37114 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
37115 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
37116 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
37117 ATTITUDE_QUATERNION_DATA::random(rng),
37118 )),
37119 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
37120 ATTITUDE_QUATERNION_COV_DATA::random(rng),
37121 )),
37122 ATTITUDE_TARGET_DATA::ID => {
37123 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
37124 }
37125 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
37126 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
37127 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37128 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
37129 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
37130 ))
37131 }
37132 AUTOPILOT_VERSION_DATA::ID => {
37133 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
37134 }
37135 AVAILABLE_MODES_DATA::ID => {
37136 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
37137 }
37138 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
37139 AVAILABLE_MODES_MONITOR_DATA::random(rng),
37140 )),
37141 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
37142 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
37143 BATTERY_STATUS_V2_DATA::ID => {
37144 Some(Self::BATTERY_STATUS_V2(BATTERY_STATUS_V2_DATA::random(rng)))
37145 }
37146 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
37147 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
37148 CAMERA_CAPTURE_STATUS_DATA::random(rng),
37149 )),
37150 CAMERA_FOV_STATUS_DATA::ID => {
37151 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
37152 }
37153 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
37154 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
37155 )),
37156 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
37157 CAMERA_INFORMATION_DATA::random(rng),
37158 )),
37159 CAMERA_SETTINGS_DATA::ID => {
37160 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
37161 }
37162 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
37163 CAMERA_THERMAL_RANGE_DATA::random(rng),
37164 )),
37165 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
37166 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
37167 )),
37168 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
37169 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
37170 )),
37171 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
37172 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
37173 CAN_FILTER_MODIFY_DATA::ID => {
37174 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
37175 }
37176 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
37177 CELLULAR_CONFIG_DATA::ID => {
37178 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
37179 }
37180 CELLULAR_STATUS_DATA::ID => {
37181 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
37182 }
37183 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
37184 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
37185 )),
37186 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
37187 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
37188 )),
37189 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
37190 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
37191 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
37192 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
37193 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
37194 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
37195 COMPONENT_INFORMATION_DATA::random(rng),
37196 )),
37197 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
37198 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
37199 )),
37200 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
37201 COMPONENT_METADATA_DATA::random(rng),
37202 )),
37203 CONTROL_STATUS_DATA::ID => Some(Self::CONTROL_STATUS(CONTROL_STATUS_DATA::random(rng))),
37204 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
37205 CONTROL_SYSTEM_STATE_DATA::random(rng),
37206 )),
37207 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
37208 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
37209 )),
37210 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
37211 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
37212 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
37213 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
37214 )),
37215 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
37216 DEBUG_FLOAT_ARRAY_DATA::ID => {
37217 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
37218 }
37219 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
37220 DISTANCE_SENSOR_DATA::ID => {
37221 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
37222 }
37223 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
37224 ENCAPSULATED_DATA_DATA::ID => {
37225 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
37226 }
37227 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
37228 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
37229 ESTIMATOR_STATUS_DATA::ID => {
37230 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
37231 }
37232 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
37233 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
37234 EXTENDED_SYS_STATE_DATA::random(rng),
37235 )),
37236 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
37237 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => Some(Self::FIGURE_EIGHT_EXECUTION_STATUS(
37238 FIGURE_EIGHT_EXECUTION_STATUS_DATA::random(rng),
37239 )),
37240 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
37241 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
37242 )),
37243 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
37244 FLIGHT_INFORMATION_DATA::random(rng),
37245 )),
37246 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
37247 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
37248 GENERATOR_STATUS_DATA::ID => {
37249 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
37250 }
37251 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
37252 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
37253 )),
37254 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
37255 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
37256 )),
37257 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
37258 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
37259 )),
37260 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
37261 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
37262 )),
37263 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
37264 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
37265 )),
37266 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37267 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
37268 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
37269 ))
37270 }
37271 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
37272 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
37273 )),
37274 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
37275 GIMBAL_MANAGER_STATUS_DATA::random(rng),
37276 )),
37277 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
37278 GLOBAL_POSITION_INT_DATA::random(rng),
37279 )),
37280 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
37281 GLOBAL_POSITION_INT_COV_DATA::random(rng),
37282 )),
37283 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37284 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
37285 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
37286 ))
37287 }
37288 GNSS_INTEGRITY_DATA::ID => Some(Self::GNSS_INTEGRITY(GNSS_INTEGRITY_DATA::random(rng))),
37289 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
37290 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
37291 GPS_GLOBAL_ORIGIN_DATA::ID => {
37292 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
37293 }
37294 GPS_INJECT_DATA_DATA::ID => {
37295 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
37296 }
37297 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
37298 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
37299 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
37300 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
37301 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
37302 GROUP_END_DATA::ID => Some(Self::GROUP_END(GROUP_END_DATA::random(rng))),
37303 GROUP_START_DATA::ID => Some(Self::GROUP_START(GROUP_START_DATA::random(rng))),
37304 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
37305 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
37306 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
37307 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
37308 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
37309 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
37310 )),
37311 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
37312 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
37313 HIL_OPTICAL_FLOW_DATA::ID => {
37314 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
37315 }
37316 HIL_RC_INPUTS_RAW_DATA::ID => {
37317 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
37318 }
37319 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
37320 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
37321 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
37322 HIL_STATE_QUATERNION_DATA::random(rng),
37323 )),
37324 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
37325 HYGROMETER_SENSOR_DATA::ID => {
37326 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
37327 }
37328 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
37329 ILLUMINATOR_STATUS_DATA::random(rng),
37330 )),
37331 ISBD_LINK_STATUS_DATA::ID => {
37332 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
37333 }
37334 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
37335 LINK_NODE_STATUS_DATA::ID => {
37336 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
37337 }
37338 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
37339 LOCAL_POSITION_NED_DATA::random(rng),
37340 )),
37341 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
37342 LOCAL_POSITION_NED_COV_DATA::random(rng),
37343 )),
37344 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37345 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
37346 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
37347 ))
37348 }
37349 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
37350 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
37351 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
37352 LOGGING_DATA_ACKED_DATA::random(rng),
37353 )),
37354 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
37355 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
37356 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
37357 LOG_REQUEST_DATA_DATA::ID => {
37358 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
37359 }
37360 LOG_REQUEST_END_DATA::ID => {
37361 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
37362 }
37363 LOG_REQUEST_LIST_DATA::ID => {
37364 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
37365 }
37366 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
37367 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
37368 MANUAL_SETPOINT_DATA::ID => {
37369 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
37370 }
37371 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
37372 MESSAGE_INTERVAL_DATA::ID => {
37373 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
37374 }
37375 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
37376 MISSION_CLEAR_ALL_DATA::ID => {
37377 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
37378 }
37379 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
37380 MISSION_CURRENT_DATA::ID => {
37381 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
37382 }
37383 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
37384 MISSION_ITEM_INT_DATA::ID => {
37385 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
37386 }
37387 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
37388 MISSION_ITEM_REACHED_DATA::random(rng),
37389 )),
37390 MISSION_REQUEST_DATA::ID => {
37391 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
37392 }
37393 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
37394 MISSION_REQUEST_INT_DATA::random(rng),
37395 )),
37396 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
37397 MISSION_REQUEST_LIST_DATA::random(rng),
37398 )),
37399 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
37400 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
37401 )),
37402 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
37403 MISSION_SET_CURRENT_DATA::random(rng),
37404 )),
37405 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
37406 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
37407 )),
37408 MOUNT_ORIENTATION_DATA::ID => {
37409 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
37410 }
37411 NAMED_VALUE_FLOAT_DATA::ID => {
37412 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
37413 }
37414 NAMED_VALUE_INT_DATA::ID => {
37415 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
37416 }
37417 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
37418 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
37419 )),
37420 OBSTACLE_DISTANCE_DATA::ID => {
37421 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
37422 }
37423 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
37424 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
37425 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
37426 )),
37427 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
37428 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
37429 )),
37430 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
37431 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
37432 )),
37433 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
37434 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
37435 )),
37436 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
37437 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
37438 )),
37439 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
37440 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
37441 )),
37442 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
37443 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
37444 )),
37445 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
37446 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
37447 )),
37448 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
37449 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
37450 )),
37451 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
37452 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
37453 )),
37454 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
37455 OPTICAL_FLOW_RAD_DATA::ID => {
37456 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
37457 }
37458 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
37459 ORBIT_EXECUTION_STATUS_DATA::random(rng),
37460 )),
37461 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
37462 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
37463 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
37464 )),
37465 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
37466 PARAM_EXT_REQUEST_READ_DATA::random(rng),
37467 )),
37468 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
37469 PARAM_EXT_VALUE_DATA::ID => {
37470 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
37471 }
37472 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
37473 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
37474 PARAM_REQUEST_LIST_DATA::random(rng),
37475 )),
37476 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
37477 PARAM_REQUEST_READ_DATA::random(rng),
37478 )),
37479 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
37480 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
37481 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
37482 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
37483 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
37484 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
37485 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37486 )),
37487 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
37488 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37489 )),
37490 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
37491 PROTOCOL_VERSION_DATA::ID => {
37492 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
37493 }
37494 RADIO_RC_CHANNELS_DATA::ID => {
37495 Some(Self::RADIO_RC_CHANNELS(RADIO_RC_CHANNELS_DATA::random(rng)))
37496 }
37497 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
37498 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
37499 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
37500 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
37501 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
37502 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
37503 RC_CHANNELS_OVERRIDE_DATA::random(rng),
37504 )),
37505 RC_CHANNELS_RAW_DATA::ID => {
37506 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
37507 }
37508 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
37509 RC_CHANNELS_SCALED_DATA::random(rng),
37510 )),
37511 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
37512 REQUEST_DATA_STREAM_DATA::random(rng),
37513 )),
37514 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
37515 RESOURCE_REQUEST_DATA::ID => {
37516 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
37517 }
37518 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
37519 RESPONSE_EVENT_ERROR_DATA::random(rng),
37520 )),
37521 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
37522 SAFETY_ALLOWED_AREA_DATA::random(rng),
37523 )),
37524 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
37525 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
37526 )),
37527 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
37528 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
37529 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
37530 SCALED_PRESSURE_DATA::ID => {
37531 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
37532 }
37533 SCALED_PRESSURE2_DATA::ID => {
37534 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
37535 }
37536 SCALED_PRESSURE3_DATA::ID => {
37537 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
37538 }
37539 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
37540 SERVO_OUTPUT_RAW_DATA::ID => {
37541 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
37542 }
37543 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
37544 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37545 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37546 )),
37547 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37548 SET_ATTITUDE_TARGET_DATA::random(rng),
37549 )),
37550 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37551 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
37552 )),
37553 SET_HOME_POSITION_DATA::ID => {
37554 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
37555 }
37556 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
37557 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37558 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37559 )),
37560 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37561 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37562 )),
37563 SET_VELOCITY_LIMITS_DATA::ID => Some(Self::SET_VELOCITY_LIMITS(
37564 SET_VELOCITY_LIMITS_DATA::random(rng),
37565 )),
37566 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
37567 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
37568 SMART_BATTERY_INFO_DATA::random(rng),
37569 )),
37570 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
37571 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37572 STORAGE_INFORMATION_DATA::random(rng),
37573 )),
37574 SUPPORTED_TUNES_DATA::ID => {
37575 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
37576 }
37577 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
37578 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
37579 TARGET_ABSOLUTE_DATA::ID => {
37580 Some(Self::TARGET_ABSOLUTE(TARGET_ABSOLUTE_DATA::random(rng)))
37581 }
37582 TARGET_RELATIVE_DATA::ID => {
37583 Some(Self::TARGET_RELATIVE(TARGET_RELATIVE_DATA::random(rng)))
37584 }
37585 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
37586 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
37587 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
37588 TERRAIN_REQUEST_DATA::ID => {
37589 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
37590 }
37591 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
37592 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37593 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
37594 )),
37595 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37596 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37597 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
37598 ))
37599 }
37600 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37601 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37602 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
37603 ))
37604 }
37605 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
37606 UAVCAN_NODE_INFO_DATA::ID => {
37607 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
37608 }
37609 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
37610 UAVCAN_NODE_STATUS_DATA::random(rng),
37611 )),
37612 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37613 UTM_GLOBAL_POSITION_DATA::random(rng),
37614 )),
37615 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
37616 VELOCITY_LIMITS_DATA::ID => {
37617 Some(Self::VELOCITY_LIMITS(VELOCITY_LIMITS_DATA::random(rng)))
37618 }
37619 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
37620 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
37621 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37622 VICON_POSITION_ESTIMATE_DATA::random(rng),
37623 )),
37624 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37625 VIDEO_STREAM_INFORMATION_DATA::random(rng),
37626 )),
37627 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37628 VIDEO_STREAM_STATUS_DATA::random(rng),
37629 )),
37630 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37631 VISION_POSITION_ESTIMATE_DATA::random(rng),
37632 )),
37633 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37634 VISION_SPEED_ESTIMATE_DATA::random(rng),
37635 )),
37636 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
37637 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
37638 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
37639 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
37640 _ => None,
37641 }
37642 }
37643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37644 match self {
37645 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37646 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
37647 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
37648 Self::AIRSPEED(body) => body.ser(version, bytes),
37649 Self::AIS_VESSEL(body) => body.ser(version, bytes),
37650 Self::ALTITUDE(body) => body.ser(version, bytes),
37651 Self::ATTITUDE(body) => body.ser(version, bytes),
37652 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
37653 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
37654 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
37655 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
37656 Self::AUTH_KEY(body) => body.ser(version, bytes),
37657 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
37658 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
37659 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
37660 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
37661 Self::BATTERY_INFO(body) => body.ser(version, bytes),
37662 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
37663 Self::BATTERY_STATUS_V2(body) => body.ser(version, bytes),
37664 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
37665 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
37666 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
37667 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
37668 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
37669 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
37670 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
37671 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
37672 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
37673 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
37674 Self::CANFD_FRAME(body) => body.ser(version, bytes),
37675 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
37676 Self::CAN_FRAME(body) => body.ser(version, bytes),
37677 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
37678 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
37679 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
37680 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
37681 Self::COLLISION(body) => body.ser(version, bytes),
37682 Self::COMMAND_ACK(body) => body.ser(version, bytes),
37683 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
37684 Self::COMMAND_INT(body) => body.ser(version, bytes),
37685 Self::COMMAND_LONG(body) => body.ser(version, bytes),
37686 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
37687 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
37688 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
37689 Self::CONTROL_STATUS(body) => body.ser(version, bytes),
37690 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
37691 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
37692 Self::CURRENT_MODE(body) => body.ser(version, bytes),
37693 Self::DATA_STREAM(body) => body.ser(version, bytes),
37694 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
37695 Self::DEBUG(body) => body.ser(version, bytes),
37696 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
37697 Self::DEBUG_VECT(body) => body.ser(version, bytes),
37698 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
37699 Self::EFI_STATUS(body) => body.ser(version, bytes),
37700 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
37701 Self::ESC_INFO(body) => body.ser(version, bytes),
37702 Self::ESC_STATUS(body) => body.ser(version, bytes),
37703 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
37704 Self::EVENT(body) => body.ser(version, bytes),
37705 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
37706 Self::FENCE_STATUS(body) => body.ser(version, bytes),
37707 Self::FIGURE_EIGHT_EXECUTION_STATUS(body) => body.ser(version, bytes),
37708 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
37709 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
37710 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
37711 Self::FUEL_STATUS(body) => body.ser(version, bytes),
37712 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
37713 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
37714 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
37715 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
37716 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
37717 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
37718 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
37719 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
37720 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
37721 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
37722 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
37723 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37724 Self::GNSS_INTEGRITY(body) => body.ser(version, bytes),
37725 Self::GPS2_RAW(body) => body.ser(version, bytes),
37726 Self::GPS2_RTK(body) => body.ser(version, bytes),
37727 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37728 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
37729 Self::GPS_INPUT(body) => body.ser(version, bytes),
37730 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
37731 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
37732 Self::GPS_RTK(body) => body.ser(version, bytes),
37733 Self::GPS_STATUS(body) => body.ser(version, bytes),
37734 Self::GROUP_END(body) => body.ser(version, bytes),
37735 Self::GROUP_START(body) => body.ser(version, bytes),
37736 Self::HEARTBEAT(body) => body.ser(version, bytes),
37737 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
37738 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
37739 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
37740 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
37741 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
37742 Self::HIL_GPS(body) => body.ser(version, bytes),
37743 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
37744 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
37745 Self::HIL_SENSOR(body) => body.ser(version, bytes),
37746 Self::HIL_STATE(body) => body.ser(version, bytes),
37747 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
37748 Self::HOME_POSITION(body) => body.ser(version, bytes),
37749 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
37750 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
37751 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
37752 Self::LANDING_TARGET(body) => body.ser(version, bytes),
37753 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
37754 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
37755 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
37756 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
37757 Self::LOGGING_ACK(body) => body.ser(version, bytes),
37758 Self::LOGGING_DATA(body) => body.ser(version, bytes),
37759 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
37760 Self::LOG_DATA(body) => body.ser(version, bytes),
37761 Self::LOG_ENTRY(body) => body.ser(version, bytes),
37762 Self::LOG_ERASE(body) => body.ser(version, bytes),
37763 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
37764 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
37765 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
37766 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
37767 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
37768 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
37769 Self::MEMORY_VECT(body) => body.ser(version, bytes),
37770 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
37771 Self::MISSION_ACK(body) => body.ser(version, bytes),
37772 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
37773 Self::MISSION_COUNT(body) => body.ser(version, bytes),
37774 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
37775 Self::MISSION_ITEM(body) => body.ser(version, bytes),
37776 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
37777 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
37778 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
37779 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
37780 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
37781 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
37782 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
37783 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
37784 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
37785 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
37786 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
37787 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
37788 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
37789 Self::ODOMETRY(body) => body.ser(version, bytes),
37790 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
37791 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
37792 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
37793 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
37794 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
37795 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
37796 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
37797 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
37798 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
37799 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
37800 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
37801 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
37802 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
37803 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
37804 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
37805 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
37806 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
37807 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
37808 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
37809 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
37810 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
37811 Self::PARAM_SET(body) => body.ser(version, bytes),
37812 Self::PARAM_VALUE(body) => body.ser(version, bytes),
37813 Self::PING(body) => body.ser(version, bytes),
37814 Self::PLAY_TUNE(body) => body.ser(version, bytes),
37815 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
37816 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37817 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37818 Self::POWER_STATUS(body) => body.ser(version, bytes),
37819 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
37820 Self::RADIO_RC_CHANNELS(body) => body.ser(version, bytes),
37821 Self::RADIO_STATUS(body) => body.ser(version, bytes),
37822 Self::RAW_IMU(body) => body.ser(version, bytes),
37823 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
37824 Self::RAW_RPM(body) => body.ser(version, bytes),
37825 Self::RC_CHANNELS(body) => body.ser(version, bytes),
37826 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
37827 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
37828 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
37829 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
37830 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
37831 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
37832 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
37833 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
37834 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
37835 Self::SCALED_IMU(body) => body.ser(version, bytes),
37836 Self::SCALED_IMU2(body) => body.ser(version, bytes),
37837 Self::SCALED_IMU3(body) => body.ser(version, bytes),
37838 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
37839 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
37840 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
37841 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
37842 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
37843 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
37844 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37845 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
37846 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37847 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
37848 Self::SET_MODE(body) => body.ser(version, bytes),
37849 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37850 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37851 Self::SET_VELOCITY_LIMITS(body) => body.ser(version, bytes),
37852 Self::SIM_STATE(body) => body.ser(version, bytes),
37853 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
37854 Self::STATUSTEXT(body) => body.ser(version, bytes),
37855 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
37856 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
37857 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
37858 Self::SYS_STATUS(body) => body.ser(version, bytes),
37859 Self::TARGET_ABSOLUTE(body) => body.ser(version, bytes),
37860 Self::TARGET_RELATIVE(body) => body.ser(version, bytes),
37861 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
37862 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
37863 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
37864 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
37865 Self::TIMESYNC(body) => body.ser(version, bytes),
37866 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
37867 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
37868 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
37869 Self::TUNNEL(body) => body.ser(version, bytes),
37870 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
37871 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
37872 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
37873 Self::V2_EXTENSION(body) => body.ser(version, bytes),
37874 Self::VELOCITY_LIMITS(body) => body.ser(version, bytes),
37875 Self::VFR_HUD(body) => body.ser(version, bytes),
37876 Self::VIBRATION(body) => body.ser(version, bytes),
37877 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37878 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
37879 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
37880 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37881 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
37882 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
37883 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
37884 Self::WINCH_STATUS(body) => body.ser(version, bytes),
37885 Self::WIND_COV(body) => body.ser(version, bytes),
37886 }
37887 }
37888 fn extra_crc(id: u32) -> u8 {
37889 match id {
37890 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
37891 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
37892 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
37893 AIRSPEED_DATA::ID => AIRSPEED_DATA::EXTRA_CRC,
37894 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
37895 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
37896 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
37897 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
37898 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
37899 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
37900 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
37901 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
37902 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37903 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
37904 }
37905 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
37906 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
37907 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
37908 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
37909 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
37910 BATTERY_STATUS_V2_DATA::ID => BATTERY_STATUS_V2_DATA::EXTRA_CRC,
37911 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
37912 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
37913 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
37914 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
37915 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
37916 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
37917 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
37918 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
37919 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
37920 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
37921 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
37922 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
37923 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
37924 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
37925 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
37926 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
37927 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
37928 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
37929 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
37930 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
37931 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
37932 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
37933 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
37934 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
37935 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
37936 CONTROL_STATUS_DATA::ID => CONTROL_STATUS_DATA::EXTRA_CRC,
37937 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
37938 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
37939 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
37940 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
37941 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
37942 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
37943 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
37944 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
37945 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
37946 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
37947 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
37948 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
37949 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
37950 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
37951 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
37952 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
37953 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
37954 FIGURE_EIGHT_EXECUTION_STATUS_DATA::ID => FIGURE_EIGHT_EXECUTION_STATUS_DATA::EXTRA_CRC,
37955 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
37956 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
37957 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
37958 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
37959 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
37960 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
37961 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
37962 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
37963 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
37964 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
37965 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37966 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
37967 }
37968 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
37969 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
37970 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
37971 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
37972 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37973 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
37974 }
37975 GNSS_INTEGRITY_DATA::ID => GNSS_INTEGRITY_DATA::EXTRA_CRC,
37976 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
37977 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
37978 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
37979 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
37980 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
37981 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
37982 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
37983 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
37984 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
37985 GROUP_END_DATA::ID => GROUP_END_DATA::EXTRA_CRC,
37986 GROUP_START_DATA::ID => GROUP_START_DATA::EXTRA_CRC,
37987 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
37988 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
37989 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
37990 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
37991 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
37992 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
37993 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
37994 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
37995 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
37996 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
37997 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
37998 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
37999 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
38000 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
38001 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
38002 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
38003 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
38004 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
38005 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
38006 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
38007 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
38008 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
38009 }
38010 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
38011 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
38012 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
38013 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
38014 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
38015 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
38016 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
38017 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
38018 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
38019 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
38020 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
38021 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
38022 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
38023 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
38024 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
38025 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
38026 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
38027 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
38028 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
38029 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
38030 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
38031 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
38032 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
38033 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
38034 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
38035 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
38036 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
38037 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
38038 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
38039 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
38040 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
38041 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
38042 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
38043 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
38044 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
38045 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
38046 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
38047 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
38048 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
38049 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
38050 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
38051 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
38052 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
38053 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
38054 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
38055 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
38056 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
38057 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
38058 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
38059 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
38060 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
38061 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
38062 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
38063 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
38064 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
38065 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
38066 PING_DATA::ID => PING_DATA::EXTRA_CRC,
38067 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
38068 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
38069 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
38070 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38071 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
38072 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
38073 RADIO_RC_CHANNELS_DATA::ID => RADIO_RC_CHANNELS_DATA::EXTRA_CRC,
38074 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
38075 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
38076 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
38077 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
38078 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
38079 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
38080 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
38081 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
38082 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
38083 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
38084 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
38085 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
38086 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
38087 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
38088 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
38089 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
38090 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
38091 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
38092 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
38093 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
38094 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
38095 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
38096 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
38097 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
38098 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
38099 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
38100 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
38101 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
38102 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
38103 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
38104 }
38105 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
38106 SET_VELOCITY_LIMITS_DATA::ID => SET_VELOCITY_LIMITS_DATA::EXTRA_CRC,
38107 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
38108 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
38109 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
38110 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
38111 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
38112 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
38113 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
38114 TARGET_ABSOLUTE_DATA::ID => TARGET_ABSOLUTE_DATA::EXTRA_CRC,
38115 TARGET_RELATIVE_DATA::ID => TARGET_RELATIVE_DATA::EXTRA_CRC,
38116 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
38117 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
38118 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
38119 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
38120 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
38121 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
38122 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
38123 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
38124 }
38125 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
38126 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
38127 }
38128 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
38129 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
38130 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
38131 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
38132 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
38133 VELOCITY_LIMITS_DATA::ID => VELOCITY_LIMITS_DATA::EXTRA_CRC,
38134 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
38135 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
38136 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38137 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
38138 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
38139 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
38140 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
38141 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
38142 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
38143 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
38144 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
38145 _ => 0,
38146 }
38147 }
38148 fn target_system_id(&self) -> Option<u8> {
38149 match self {
38150 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
38151 Self::CANFD_FRAME(inner) => Some(inner.target_system),
38152 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
38153 Self::CAN_FRAME(inner) => Some(inner.target_system),
38154 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
38155 Self::COMMAND_ACK(inner) => Some(inner.target_system),
38156 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
38157 Self::COMMAND_INT(inner) => Some(inner.target_system),
38158 Self::COMMAND_LONG(inner) => Some(inner.target_system),
38159 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
38160 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
38161 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
38162 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
38163 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
38164 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
38165 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
38166 Self::LOGGING_ACK(inner) => Some(inner.target_system),
38167 Self::LOGGING_DATA(inner) => Some(inner.target_system),
38168 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
38169 Self::LOG_ERASE(inner) => Some(inner.target_system),
38170 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
38171 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
38172 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
38173 Self::MISSION_ACK(inner) => Some(inner.target_system),
38174 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
38175 Self::MISSION_COUNT(inner) => Some(inner.target_system),
38176 Self::MISSION_ITEM(inner) => Some(inner.target_system),
38177 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
38178 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
38179 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
38180 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
38181 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
38182 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
38183 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
38184 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
38185 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
38186 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
38187 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
38188 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
38189 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
38190 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
38191 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
38192 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
38193 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
38194 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
38195 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
38196 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
38197 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
38198 Self::PARAM_SET(inner) => Some(inner.target_system),
38199 Self::PING(inner) => Some(inner.target_system),
38200 Self::PLAY_TUNE(inner) => Some(inner.target_system),
38201 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
38202 Self::RADIO_RC_CHANNELS(inner) => Some(inner.target_system),
38203 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
38204 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
38205 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
38206 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
38207 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
38208 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
38209 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
38210 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
38211 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
38212 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
38213 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
38214 Self::SET_MODE(inner) => Some(inner.target_system),
38215 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
38216 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
38217 Self::SET_VELOCITY_LIMITS(inner) => Some(inner.target_system),
38218 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
38219 Self::TIMESYNC(inner) => Some(inner.target_system),
38220 Self::TUNNEL(inner) => Some(inner.target_system),
38221 Self::V2_EXTENSION(inner) => Some(inner.target_system),
38222 _ => None,
38223 }
38224 }
38225 fn target_component_id(&self) -> Option<u8> {
38226 match self {
38227 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
38228 Self::CANFD_FRAME(inner) => Some(inner.target_component),
38229 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
38230 Self::CAN_FRAME(inner) => Some(inner.target_component),
38231 Self::COMMAND_ACK(inner) => Some(inner.target_component),
38232 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
38233 Self::COMMAND_INT(inner) => Some(inner.target_component),
38234 Self::COMMAND_LONG(inner) => Some(inner.target_component),
38235 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
38236 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
38237 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
38238 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
38239 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
38240 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
38241 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
38242 Self::LOGGING_ACK(inner) => Some(inner.target_component),
38243 Self::LOGGING_DATA(inner) => Some(inner.target_component),
38244 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
38245 Self::LOG_ERASE(inner) => Some(inner.target_component),
38246 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
38247 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
38248 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
38249 Self::MISSION_ACK(inner) => Some(inner.target_component),
38250 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
38251 Self::MISSION_COUNT(inner) => Some(inner.target_component),
38252 Self::MISSION_ITEM(inner) => Some(inner.target_component),
38253 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
38254 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
38255 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
38256 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
38257 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
38258 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
38259 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
38260 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
38261 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
38262 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
38263 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
38264 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
38265 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
38266 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
38267 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
38268 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
38269 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
38270 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
38271 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
38272 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
38273 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
38274 Self::PARAM_SET(inner) => Some(inner.target_component),
38275 Self::PING(inner) => Some(inner.target_component),
38276 Self::PLAY_TUNE(inner) => Some(inner.target_component),
38277 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
38278 Self::RADIO_RC_CHANNELS(inner) => Some(inner.target_component),
38279 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
38280 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
38281 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
38282 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
38283 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
38284 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
38285 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
38286 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
38287 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
38288 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
38289 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
38290 Self::SET_VELOCITY_LIMITS(inner) => Some(inner.target_component),
38291 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
38292 Self::TIMESYNC(inner) => Some(inner.target_component),
38293 Self::TUNNEL(inner) => Some(inner.target_component),
38294 Self::V2_EXTENSION(inner) => Some(inner.target_component),
38295 _ => None,
38296 }
38297 }
38298}